{"id":1411,"date":"2016-09-14T21:42:07","date_gmt":"2016-09-14T14:42:07","guid":{"rendered":"http:\/\/huongdanjava.com\/?p=1411"},"modified":"2025-11-23T08:16:45","modified_gmt":"2025-11-23T01:16:45","slug":"understanding-about-dependency-injection","status":"publish","type":"post","link":"https:\/\/huongdanjava.com\/understanding-about-dependency-injection.html","title":{"rendered":"Understanding about Dependency Injection"},"content":{"rendered":"<p>Searching on Google, you can see that: there are a lot of tutorials about Dependency Injection, each one with a different style. Perhaps, some of you can perceive it quickly, someone is not. So, I would like to summarize again and try to write about it in an easy way to understand. (I will try my best \ud83d\ude00 ).<\/p>\n<p>The main idea of Dependency Injection is: <strong>you don&#8217;t depend on anyone<\/strong> and no one depends on you. <strong>I will call you when I need<\/strong> and you too.<\/p>\n<p>Let me talk more specifically about it!<\/p>\n<p>Someday in the past, I usually wrote my code like the below:<\/p>\n<p>Assume, you have an object Circle, this object has a method named draw() as below:<\/p>\n<pre class=\"lang:java decode:true\">package com.huongdanjava.softwaredesign;\r\n\r\npublic class Circle {\r\n\tpublic void draw() {\r\n\t\tSystem.out.println(\"Drawing circle ...\");\r\n\t}\r\n}<\/pre>\n<p>Now, I want to use this object to draw a circle, I will initialize the object Circle\u00a0within the constructor and I will write the code as below:<\/p>\n<pre class=\"lang:java decode:true\">package com.huongdanjava.softwaredesign;\r\n\r\npublic class Drawing {\r\n\tpublic Circle circle;\r\n\t\r\n\tpublic Drawing() {\r\n\t\tcircle = new Circle();\r\n\t}\r\n      \r\n\tpublic void preparing() {\r\n\t\tSystem.out.println(\"Preparing ...\");\r\n\t}\r\n\t\r\n\tpublic void draw() {\r\n\t\tcircle.draw();\r\n\t}\r\n\t\r\n\tpublic static void main(String[] args) {\r\n\t\tDrawing drawing = new Drawing();\r\n\t\tdrawing.draw();\r\n\t}\r\n}<\/pre>\n<p>Obviously, you see my object,\u00a0Drawing<strong>,<\/strong>\u00a0is depending on your object Circle\u00a0(that means I am depending on you), because every\u00a0time I\u00a0run the application, the object Drawing\u00a0must keep the information of the object Circle<strong>. <\/strong>This is the first drawback of this code.<\/p>\n<p>The second drawback is that if in the future, I want to draw a triangle, I must declare again another object to satisfy my needs. This is cause the object Drawing\u00a0will constantly change according to the needs.<\/p>\n<p>So, how can we resolve this drawback?<\/p>\n<p>The second drawback can resolve by using the interface. Your\u00a0object Circle will implement an interface named\u00a0Shape, details as below:<\/p>\n<pre class=\"lang:java decode:true\">package com.huongdanjava.softwaredesign;\r\n\r\npublic interface Shape {\r\n\tpublic void draw();\r\n}<\/pre>\n<pre class=\"lang:java decode:true\">package com.huongdanjava.softwaredesign;\r\n\r\npublic class Circle implement Shape {\r\n\tpublic void draw() {\r\n\t\tSystem.out.println(\"Drawing circle ...\");\r\n\t}\r\n}<\/pre>\n<p>In the future, if I want to draw a triangle, I only need to create a new class and implement the interface Shape.<\/p>\n<p>For the first drawback, Dependency Injection will resolve it.<\/p>\n<p>Let&#8217;s see how Dependency Injection can resolve this problem, I will modify the object Drawing\u00a0as below:<\/p>\n<pre class=\"lang:java decode:true \">package com.huongdanjava.softwaredesign;\r\n\r\npublic class Drawing {\r\n\tprivate Shape shape;\r\n\t\r\n\tpublic Drawing(Shape shape) {\r\n\t\tthis.shape = shape;\r\n\t}\r\n\t\r\n\tpublic void setShape(Shape shape) {\r\n\t\tthis.shape = shape;\r\n\t}\r\n      \r\n\tpublic void preparing() {\r\n\t\tSystem.out.println(\"Preparing ...\");\r\n\t}\r\n\t\r\n\tpublic void draw() {\r\n\t\tshape.draw();\r\n\t}\r\n}<\/pre>\n<p>As you can see, if I only need my object Drawing\u00a0to prepare the tool to draw, I don&#8217;t need to call your object\u00a0Circle, code will be:<\/p>\n<pre class=\"lang:java decode:true\">Drawing drawing = new Drawing(null);\r\ndrawing.preparing();<\/pre>\n<p>After preparing complete, I will need you to draw a circle, I will call you:<\/p>\n<pre class=\"lang:java decode:true \">Drawing drawing = new Drawing(null);\r\ndrawing.preparing();\r\n\r\nShape shape = new Circle();\r\ndrawing.setShape(shape);\r\ndrawing.draw();<\/pre>\n<p>Actually, maybe you already worked on the code but you didn&#8217;t know that this is Dependency Injection.<\/p>\n<p><strong>You can watch the video here:<\/strong><\/p>\n<p><iframe loading=\"lazy\" title=\"What Is Dependency Injection? | Easy Explanation with Examples\" width=\"825\" height=\"619\" src=\"https:\/\/www.youtube.com\/embed\/HVts3COf3Uk?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n\n\n<div class=\"kk-star-ratings kksr-auto kksr-align-right kksr-valign-bottom\"\n    data-payload='{&quot;align&quot;:&quot;right&quot;,&quot;id&quot;:&quot;1411&quot;,&quot;slug&quot;:&quot;default&quot;,&quot;valign&quot;:&quot;bottom&quot;,&quot;ignore&quot;:&quot;&quot;,&quot;reference&quot;:&quot;auto&quot;,&quot;class&quot;:&quot;&quot;,&quot;count&quot;:&quot;0&quot;,&quot;legendonly&quot;:&quot;&quot;,&quot;readonly&quot;:&quot;&quot;,&quot;score&quot;:&quot;0&quot;,&quot;starsonly&quot;:&quot;&quot;,&quot;best&quot;:&quot;5&quot;,&quot;gap&quot;:&quot;4&quot;,&quot;greet&quot;:&quot;&quot;,&quot;legend&quot;:&quot;0\\\/5 - (0 votes)&quot;,&quot;size&quot;:&quot;24&quot;,&quot;title&quot;:&quot;Understanding about Dependency Injection&quot;,&quot;width&quot;:&quot;0&quot;,&quot;_legend&quot;:&quot;{score}\\\/{best} - ({count} {votes})&quot;,&quot;font_factor&quot;:&quot;1.25&quot;}'>\n            \n<div class=\"kksr-stars\">\n    \n<div class=\"kksr-stars-inactive\">\n            <div class=\"kksr-star\" data-star=\"1\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"2\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"3\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"4\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" data-star=\"5\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n    \n<div class=\"kksr-stars-active\" style=\"width: 0px;\">\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n            <div class=\"kksr-star\" style=\"padding-right: 4px\">\n            \n\n<div class=\"kksr-icon\" style=\"width: 24px; height: 24px;\"><\/div>\n        <\/div>\n    <\/div>\n<\/div>\n                \n\n<div class=\"kksr-legend\" style=\"font-size: 19.2px;\">\n            <span class=\"kksr-muted\"><\/span>\n    <\/div>\n    <\/div>\n","protected":false},"excerpt":{"rendered":"<p>Searching on Google, you can see that: there are a lot of tutorials about Dependency Injection, each one with a different style. Perhaps, some of you can perceive it quickly, someone is not. So, I would like to summarize again and try to write about&hellip; <a href=\"https:\/\/huongdanjava.com\/understanding-about-dependency-injection.html\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":57,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[393],"tags":[395],"class_list":["post-1411","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-design-pattern-en","tag-dependency-injection-en","clearfix"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Understanding about Dependency Injection - Huong Dan Java<\/title>\n<meta name=\"description\" content=\"In this tutorial, I will talk will you about the Dependency Injection.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/huongdanjava.com\/understanding-about-dependency-injection.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Understanding about Dependency Injection - Huong Dan Java\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, I will talk will you about the Dependency Injection.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/huongdanjava.com\/understanding-about-dependency-injection.html\" \/>\n<meta property=\"og:site_name\" content=\"Huong Dan Java\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/nhkhanh2406\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/nhkhanh2406\" \/>\n<meta property=\"article:published_time\" content=\"2016-09-14T14:42:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-23T01:16:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/huongdanjava.com\/wp-content\/uploads\/2016\/02\/dependency-injection.png\" \/>\n\t<meta property=\"og:image:width\" content=\"840\" \/>\n\t<meta property=\"og:image:height\" content=\"417\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Khanh Nguyen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/KhanhNguyenJ\" \/>\n<meta name=\"twitter:site\" content=\"@KhanhNguyenJ\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Khanh Nguyen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/understanding-about-dependency-injection.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/understanding-about-dependency-injection.html\"},\"author\":{\"name\":\"Khanh Nguyen\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\"},\"headline\":\"Understanding about Dependency Injection\",\"datePublished\":\"2016-09-14T14:42:07+00:00\",\"dateModified\":\"2025-11-23T01:16:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/understanding-about-dependency-injection.html\"},\"wordCount\":384,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\"},\"image\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/understanding-about-dependency-injection.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2016\\\/02\\\/dependency-injection.png\",\"keywords\":[\"Dependency Injection\"],\"articleSection\":[\"Design Pattern\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/huongdanjava.com\\\/understanding-about-dependency-injection.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/understanding-about-dependency-injection.html\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/understanding-about-dependency-injection.html\",\"name\":\"Understanding about Dependency Injection - Huong Dan Java\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/understanding-about-dependency-injection.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/understanding-about-dependency-injection.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2016\\\/02\\\/dependency-injection.png\",\"datePublished\":\"2016-09-14T14:42:07+00:00\",\"dateModified\":\"2025-11-23T01:16:45+00:00\",\"description\":\"In this tutorial, I will talk will you about the Dependency Injection.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/understanding-about-dependency-injection.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/huongdanjava.com\\\/understanding-about-dependency-injection.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/understanding-about-dependency-injection.html#primaryimage\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2016\\\/02\\\/dependency-injection.png\",\"contentUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2016\\\/02\\\/dependency-injection.png\",\"width\":840,\"height\":417},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/understanding-about-dependency-injection.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/huongdanjava.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Understanding about Dependency Injection\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#website\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/\",\"name\":\"Huong Dan Java\",\"description\":\"Java development tutorials\",\"publisher\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/huongdanjava.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/#\\\/schema\\\/person\\\/dc859d7f8cbea3b593e6738de9cbb82d\",\"name\":\"Khanh Nguyen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\",\"url\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\",\"contentUrl\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\",\"width\":1267,\"height\":1517,\"caption\":\"Khanh Nguyen\"},\"logo\":{\"@id\":\"https:\\\/\\\/huongdanjava.com\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg\"},\"description\":\"I love Java and everything related to Java.\",\"sameAs\":[\"https:\\\/\\\/huongdanjava.com\",\"https:\\\/\\\/www.facebook.com\\\/nhkhanh2406\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/KhanhNguyenJ\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Understanding about Dependency Injection - Huong Dan Java","description":"In this tutorial, I will talk will you about the Dependency Injection.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/huongdanjava.com\/understanding-about-dependency-injection.html","og_locale":"en_US","og_type":"article","og_title":"Understanding about Dependency Injection - Huong Dan Java","og_description":"In this tutorial, I will talk will you about the Dependency Injection.","og_url":"https:\/\/huongdanjava.com\/understanding-about-dependency-injection.html","og_site_name":"Huong Dan Java","article_publisher":"https:\/\/www.facebook.com\/nhkhanh2406","article_author":"https:\/\/www.facebook.com\/nhkhanh2406","article_published_time":"2016-09-14T14:42:07+00:00","article_modified_time":"2025-11-23T01:16:45+00:00","og_image":[{"width":840,"height":417,"url":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2016\/02\/dependency-injection.png","type":"image\/png"}],"author":"Khanh Nguyen","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/KhanhNguyenJ","twitter_site":"@KhanhNguyenJ","twitter_misc":{"Written by":"Khanh Nguyen","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/huongdanjava.com\/understanding-about-dependency-injection.html#article","isPartOf":{"@id":"https:\/\/huongdanjava.com\/understanding-about-dependency-injection.html"},"author":{"name":"Khanh Nguyen","@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d"},"headline":"Understanding about Dependency Injection","datePublished":"2016-09-14T14:42:07+00:00","dateModified":"2025-11-23T01:16:45+00:00","mainEntityOfPage":{"@id":"https:\/\/huongdanjava.com\/understanding-about-dependency-injection.html"},"wordCount":384,"commentCount":0,"publisher":{"@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d"},"image":{"@id":"https:\/\/huongdanjava.com\/understanding-about-dependency-injection.html#primaryimage"},"thumbnailUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2016\/02\/dependency-injection.png","keywords":["Dependency Injection"],"articleSection":["Design Pattern"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/huongdanjava.com\/understanding-about-dependency-injection.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/huongdanjava.com\/understanding-about-dependency-injection.html","url":"https:\/\/huongdanjava.com\/understanding-about-dependency-injection.html","name":"Understanding about Dependency Injection - Huong Dan Java","isPartOf":{"@id":"https:\/\/huongdanjava.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/huongdanjava.com\/understanding-about-dependency-injection.html#primaryimage"},"image":{"@id":"https:\/\/huongdanjava.com\/understanding-about-dependency-injection.html#primaryimage"},"thumbnailUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2016\/02\/dependency-injection.png","datePublished":"2016-09-14T14:42:07+00:00","dateModified":"2025-11-23T01:16:45+00:00","description":"In this tutorial, I will talk will you about the Dependency Injection.","breadcrumb":{"@id":"https:\/\/huongdanjava.com\/understanding-about-dependency-injection.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/huongdanjava.com\/understanding-about-dependency-injection.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/huongdanjava.com\/understanding-about-dependency-injection.html#primaryimage","url":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2016\/02\/dependency-injection.png","contentUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2016\/02\/dependency-injection.png","width":840,"height":417},{"@type":"BreadcrumbList","@id":"https:\/\/huongdanjava.com\/understanding-about-dependency-injection.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/huongdanjava.com\/"},{"@type":"ListItem","position":2,"name":"Understanding about Dependency Injection"}]},{"@type":"WebSite","@id":"https:\/\/huongdanjava.com\/#website","url":"https:\/\/huongdanjava.com\/","name":"Huong Dan Java","description":"Java development tutorials","publisher":{"@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/huongdanjava.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/huongdanjava.com\/#\/schema\/person\/dc859d7f8cbea3b593e6738de9cbb82d","name":"Khanh Nguyen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg","url":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg","contentUrl":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg","width":1267,"height":1517,"caption":"Khanh Nguyen"},"logo":{"@id":"https:\/\/huongdanjava.com\/wp-content\/uploads\/2021\/07\/CC6FAC58-D227-4DD8-93D1-6D6A795577E3_1_201_a.jpeg"},"description":"I love Java and everything related to Java.","sameAs":["https:\/\/huongdanjava.com","https:\/\/www.facebook.com\/nhkhanh2406","https:\/\/x.com\/https:\/\/twitter.com\/KhanhNguyenJ"]}]}},"_links":{"self":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts\/1411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/comments?post=1411"}],"version-history":[{"count":13,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts\/1411\/revisions"}],"predecessor-version":[{"id":24877,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/posts\/1411\/revisions\/24877"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/media\/57"}],"wp:attachment":[{"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/media?parent=1411"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/categories?post=1411"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/huongdanjava.com\/wp-json\/wp\/v2\/tags?post=1411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}