{"id":10762,"date":"2017-05-31T15:21:57","date_gmt":"2017-05-31T13:21:57","guid":{"rendered":"https:\/\/techmoz.net\/?p=10762"},"modified":"2021-03-01T15:59:03","modified_gmt":"2021-03-01T13:59:03","slug":"avoid-private-field-dependency-injection-here-is-why","status":"publish","type":"post","link":"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/","title":{"rendered":"Avoid private field dependency injection &#8211; here is why"},"content":{"rendered":"<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Dependency_injection\" target=\"_blank\" rel=\"noopener\">Dependency injection<\/a> is a great way of decoupling system components, assuming they are written using a contract-implementation approach.<\/p>\n<p>The dependency injection containers allow you to select the desired component implementation to be injected into a specific component, or they might just find one implementation for you in your <a href=\"https:\/\/en.wikipedia.org\/wiki\/Classpath_(Java)\" target=\"_blank\" rel=\"noopener\">classpath<\/a>, or better, they can create one implementation on the fly, as <a href=\"https:\/\/en.wikipedia.org\/wiki\/Spring_Framework\" target=\"_blank\" rel=\"noopener\">Spring<\/a> does (Spring-Data).<\/p>\n<p>In Java, DI containers do more than beans lookup. They also manage beans lifecycle and do other stuff I&#8217;m not going to be talking about. I will focus on how we use the DI containers and not on what they offer.<\/p>\n<h3>Our study case:<\/h3>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n@Dependent\r\npublic class Order{\r\n\r\n    \/\/...\r\n \r\n    @Inject\r\n\r\n    private PaymentsGateway payments;\r\n\r\n\r\n    public void pay(){\r\n\r\n       \/\/do payment here\r\n\r\n    }\r\n\r\n  \r\n    \/\/...\r\n\r\n}\r\n<\/pre>\n<p>I&#8217;m pretty sure you recognize that code. Pay attention on the payments field:<\/p>\n<h3>Encapsulation with zero effort<\/h3>\n<p>Being private, the payments field is well <a href=\"https:\/\/en.wikipedia.org\/wiki\/Encapsulation_(computer_programming)\" target=\"_blank\" rel=\"noopener\">encapsulated<\/a>, meaning no external component will have access to it, unless we expose it willingly through a getter method.<\/p>\n<h3>Immutability with zero effort<\/h3>\n<p>If the Order class does not offer a setter method to modify the payments field nor a constructor, then, we can assume the Order class is <a href=\"https:\/\/en.wikipedia.org\/wiki\/Immutable_object\" target=\"_blank\" rel=\"noopener\">Immutable<\/a>. Once the DI container sets a value there, nothing else can change it, of course, unless we put on some gloves and use reflection to dig (this is actually how the DI container changes the field&#8217;s value).<\/p>\n<p>We already know how good is to use private field dependency injection. Now, lets face the reality: how bad is it? Wait! I&#8217;m not just going to pull up a CONS list and System.out.println it. Not really. I will do it in a more elegant way:<\/p>\n<h3>When I figured out private field dependency injection was evil<\/h3>\n<p>I was writing a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Immutable_object\" target=\"_blank\" rel=\"noopener\">CDI<\/a> based project and I had to write a few unit tests on classes that were using private field dependency injection. I needed to start a CDI container within my tests. I was going to use <a href=\"https:\/\/deltaspike.apache.org\/\" target=\"_blank\" rel=\"noopener\">DeltaSpike<\/a> as usual, but something made me stop and ask myself &#8220;Why do I need to start a DI container to run some basic unit tests?&#8221;. The answer was &#8220;because I have no way to set a value to the private field&#8221;. All I wanted was to inject a mock component to the bean under tests. I couldn\u2019t, because I had no way to set the mock component instance to the private field. I was coupled to the DI container because only the container could change that field. I could have used <a href=\"https:\/\/en.wikipedia.org\/wiki\/Reflection_(computer_programming)\" target=\"_blank\" rel=\"noopener\">Reflection<\/a>, but, my test code would fail after each <a href=\"https:\/\/en.wikipedia.org\/wiki\/Code_refactoring\" target=\"_blank\" rel=\"noopener\">refactoring<\/a> session, because in reflection I would be referring to the field name as a string and that name could change while refactoring. On the other hand, using reflection is a hack. I was looking for a <strong>more natural and elegant solution<\/strong>.<\/p>\n<p><em>The solution was already there, I just had to look closely:<\/em><\/p>\n<p>When you want to be able to define the value of a private field, you have two options: The first one is to <strong>create a constructor<\/strong> that receives the value to be set and the second one is to <strong>create a setter<\/strong> for such private field.<\/p>\n<p>The difference between these two is that creating a constructor allows you to preserve the immutability, while creating the setter doesn\u2019t, meaning anything gets the chance to set a different value.<\/p>\n<p>Anyway, I wouldn\u2019t need to start a DI container within my tests, because I would be able to set the value myself. I would be decoupled from the DI container. This is the big win of Constructor and Setter based dependency injection.<\/p>\n<p>I got rid of DeltaSpike simply by adopting Constructor and Setter based dependency injection and it actually felt more natural to set the mocks myself.<\/p>\n<p>I&#8217;m not saying abandon private field injection as the article&#8217;s headline suggests, I&#8217;m saying: Be aware of what you are losing when using it. As long as you can justify it, you should use it, otherwise, you know what to do.<\/p>\n<p>Both Spring and CDI support constructor and setter based dependency injection. Lets modify the &#8220;Order&#8221; class to use constructor and setter dependency injection:<\/p>\n<h4>CDI Setter dependency injection example<\/h4>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n@Dependent\r\npublic class Order{\r\n\r\n \r\n     private PaymentsGateway payments;\r\n\r\n\r\n     @Inject\r\n\r\n     public void setPayments(PaymentsGateway p){\r\n\r\n \r\n        this.payments = p;\r\n\r\n     }\r\n\r\n}\r\n<\/pre>\n<h4>CDI Constructor dependency injection example<\/h4>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\n@Dependent\r\npublic class Order{\r\n\r\n\r\n    private PaymentsGateway payments;\r\n\r\n\r\n    @Inject\r\n\r\n    public Order(PaymentsGateway p){\r\n\r\n        this.payments = p;\r\n\r\n    }\r\n \r\n\r\n}\r\n<\/pre>\n<p>Would you stick to private field dependency injection? Would you really abandon it? Share the &#8220;why&#8221; with us. Leave a comment.<\/p>\n<p>It&#8217;s always a pleasure.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Dependency injection is a great way of decoupling system components, assuming they are written using a contract-implementation approach. The dependency injection containers allow you to select the desired component implementation to be injected into a specific component, or they might just find one implementation for you in your classpath, or better, they can create one<\/p>\n","protected":false},"author":3,"featured_media":10768,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_dcms_eufi_img":"","footnotes":"","_links_to":"","_links_to_target":""},"categories":[963,974,952,978,991,997],"tags":[],"class_list":["post-10762","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles-2","category-development-tools","category-highlights-2","category-java-2","category-programming","category-software-2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Avoid private field dependency injection - here is why - Techmoz<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Avoid private field dependency injection - here is why - Techmoz\" \/>\n<meta property=\"og:description\" content=\"Dependency injection is a great way of decoupling system components, assuming they are written using a contract-implementation approach. The dependency injection containers allow you to select the desired component implementation to be injected into a specific component, or they might just find one implementation for you in your classpath, or better, they can create one\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/\" \/>\n<meta property=\"og:site_name\" content=\"Techmoz\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/web.facebook.com\/hostmoz\" \/>\n<meta property=\"article:published_time\" content=\"2017-05-31T13:21:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-03-01T13:59:03+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techmoz.net\/wp-content\/uploads\/2021\/03\/Avoid-private-field-dependency-injection-here-is-why.jpeg\" \/>\n\t<meta property=\"og:image:width\" content=\"1087\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"M\u00e1rio J\u00fanior\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hostmoz\" \/>\n<meta name=\"twitter:site\" content=\"@hostmoz\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"M\u00e1rio J\u00fanior\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"NewsArticle\"],\"@id\":\"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/\"},\"author\":{\"name\":\"M\u00e1rio J\u00fanior\",\"@id\":\"https:\/\/techmoz.net\/#\/schema\/person\/fd20b46d911cc409a8a48646aa2eeafe\"},\"headline\":\"Avoid private field dependency injection &#8211; here is why\",\"datePublished\":\"2017-05-31T13:21:57+00:00\",\"dateModified\":\"2021-03-01T13:59:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/\"},\"wordCount\":790,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\/\/techmoz.net\/#organization\"},\"image\":{\"@id\":\"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/techmoz.net\/wp-content\/uploads\/2021\/03\/Avoid-private-field-dependency-injection-here-is-why.jpeg\",\"articleSection\":[\"Articles\",\"Development Tools\",\"Highlights\",\"Java\",\"Programming\",\"Software\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/#respond\"]}],\"copyrightYear\":\"2017\",\"copyrightHolder\":{\"@id\":\"https:\/\/techmoz.net\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/\",\"url\":\"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/\",\"name\":\"Avoid private field dependency injection - here is why - Techmoz\",\"isPartOf\":{\"@id\":\"https:\/\/techmoz.net\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/techmoz.net\/wp-content\/uploads\/2021\/03\/Avoid-private-field-dependency-injection-here-is-why.jpeg\",\"datePublished\":\"2017-05-31T13:21:57+00:00\",\"dateModified\":\"2021-03-01T13:59:03+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/#primaryimage\",\"url\":\"https:\/\/techmoz.net\/wp-content\/uploads\/2021\/03\/Avoid-private-field-dependency-injection-here-is-why.jpeg\",\"contentUrl\":\"https:\/\/techmoz.net\/wp-content\/uploads\/2021\/03\/Avoid-private-field-dependency-injection-here-is-why.jpeg\",\"width\":1087,\"height\":720,\"caption\":\"Avoid private field dependency injection - here is why\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/techmoz.net\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Avoid private field dependency injection &#8211; here is why\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/techmoz.net\/#website\",\"url\":\"https:\/\/techmoz.net\/\",\"name\":\"Techmoz\",\"description\":\"O maior Portal de Tecnologia em Mo\u00e7ambique\",\"publisher\":{\"@id\":\"https:\/\/techmoz.net\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/techmoz.net\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/techmoz.net\/#organization\",\"name\":\"Hostmoz,Lda\",\"url\":\"https:\/\/techmoz.net\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/techmoz.net\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/techmoz.test\/wp-content\/uploads\/2023\/01\/techmoz-logo.png?fit=385%2C90&ssl=1\",\"contentUrl\":\"https:\/\/techmoz.test\/wp-content\/uploads\/2023\/01\/techmoz-logo.png?fit=385%2C90&ssl=1\",\"width\":385,\"height\":90,\"caption\":\"Hostmoz,Lda\"},\"image\":{\"@id\":\"https:\/\/techmoz.net\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/web.facebook.com\/hostmoz\",\"https:\/\/x.com\/hostmoz\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/techmoz.net\/#\/schema\/person\/fd20b46d911cc409a8a48646aa2eeafe\",\"name\":\"M\u00e1rio J\u00fanior\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/techmoz.net\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1ba78c78f5737d6907dfb107a42f20c04a903414c196f57b04d376fc82cffd1e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1ba78c78f5737d6907dfb107a42f20c04a903414c196f57b04d376fc82cffd1e?s=96&d=mm&r=g\",\"caption\":\"M\u00e1rio J\u00fanior\"},\"description\":\"M\u00e1rio Francisco J\u00fanior is the Head Of Software Development at Vodacom Mozambique.\",\"url\":\"https:\/\/techmoz.net\/en\/author\/mfjunior\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Avoid private field dependency injection - here is why - Techmoz","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:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/","og_locale":"en_US","og_type":"article","og_title":"Avoid private field dependency injection - here is why - Techmoz","og_description":"Dependency injection is a great way of decoupling system components, assuming they are written using a contract-implementation approach. The dependency injection containers allow you to select the desired component implementation to be injected into a specific component, or they might just find one implementation for you in your classpath, or better, they can create one","og_url":"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/","og_site_name":"Techmoz","article_publisher":"https:\/\/web.facebook.com\/hostmoz","article_published_time":"2017-05-31T13:21:57+00:00","article_modified_time":"2021-03-01T13:59:03+00:00","og_image":[{"width":1087,"height":720,"url":"https:\/\/techmoz.net\/wp-content\/uploads\/2021\/03\/Avoid-private-field-dependency-injection-here-is-why.jpeg","type":"image\/jpeg"}],"author":"M\u00e1rio J\u00fanior","twitter_card":"summary_large_image","twitter_creator":"@hostmoz","twitter_site":"@hostmoz","twitter_misc":{"Written by":"M\u00e1rio J\u00fanior","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","NewsArticle"],"@id":"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/#article","isPartOf":{"@id":"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/"},"author":{"name":"M\u00e1rio J\u00fanior","@id":"https:\/\/techmoz.net\/#\/schema\/person\/fd20b46d911cc409a8a48646aa2eeafe"},"headline":"Avoid private field dependency injection &#8211; here is why","datePublished":"2017-05-31T13:21:57+00:00","dateModified":"2021-03-01T13:59:03+00:00","mainEntityOfPage":{"@id":"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/"},"wordCount":790,"commentCount":2,"publisher":{"@id":"https:\/\/techmoz.net\/#organization"},"image":{"@id":"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/#primaryimage"},"thumbnailUrl":"https:\/\/techmoz.net\/wp-content\/uploads\/2021\/03\/Avoid-private-field-dependency-injection-here-is-why.jpeg","articleSection":["Articles","Development Tools","Highlights","Java","Programming","Software"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/#respond"]}],"copyrightYear":"2017","copyrightHolder":{"@id":"https:\/\/techmoz.net\/#organization"}},{"@type":"WebPage","@id":"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/","url":"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/","name":"Avoid private field dependency injection - here is why - Techmoz","isPartOf":{"@id":"https:\/\/techmoz.net\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/#primaryimage"},"image":{"@id":"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/#primaryimage"},"thumbnailUrl":"https:\/\/techmoz.net\/wp-content\/uploads\/2021\/03\/Avoid-private-field-dependency-injection-here-is-why.jpeg","datePublished":"2017-05-31T13:21:57+00:00","dateModified":"2021-03-01T13:59:03+00:00","breadcrumb":{"@id":"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/#primaryimage","url":"https:\/\/techmoz.net\/wp-content\/uploads\/2021\/03\/Avoid-private-field-dependency-injection-here-is-why.jpeg","contentUrl":"https:\/\/techmoz.net\/wp-content\/uploads\/2021\/03\/Avoid-private-field-dependency-injection-here-is-why.jpeg","width":1087,"height":720,"caption":"Avoid private field dependency injection - here is why"},{"@type":"BreadcrumbList","@id":"https:\/\/techmoz.net\/en\/avoid-private-field-dependency-injection-here-is-why\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techmoz.net\/en\/"},{"@type":"ListItem","position":2,"name":"Avoid private field dependency injection &#8211; here is why"}]},{"@type":"WebSite","@id":"https:\/\/techmoz.net\/#website","url":"https:\/\/techmoz.net\/","name":"Techmoz","description":"O maior Portal de Tecnologia em Mo\u00e7ambique","publisher":{"@id":"https:\/\/techmoz.net\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techmoz.net\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techmoz.net\/#organization","name":"Hostmoz,Lda","url":"https:\/\/techmoz.net\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techmoz.net\/#\/schema\/logo\/image\/","url":"https:\/\/techmoz.test\/wp-content\/uploads\/2023\/01\/techmoz-logo.png?fit=385%2C90&ssl=1","contentUrl":"https:\/\/techmoz.test\/wp-content\/uploads\/2023\/01\/techmoz-logo.png?fit=385%2C90&ssl=1","width":385,"height":90,"caption":"Hostmoz,Lda"},"image":{"@id":"https:\/\/techmoz.net\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/web.facebook.com\/hostmoz","https:\/\/x.com\/hostmoz"]},{"@type":"Person","@id":"https:\/\/techmoz.net\/#\/schema\/person\/fd20b46d911cc409a8a48646aa2eeafe","name":"M\u00e1rio J\u00fanior","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techmoz.net\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1ba78c78f5737d6907dfb107a42f20c04a903414c196f57b04d376fc82cffd1e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1ba78c78f5737d6907dfb107a42f20c04a903414c196f57b04d376fc82cffd1e?s=96&d=mm&r=g","caption":"M\u00e1rio J\u00fanior"},"description":"M\u00e1rio Francisco J\u00fanior is the Head Of Software Development at Vodacom Mozambique.","url":"https:\/\/techmoz.net\/en\/author\/mfjunior\/"}]}},"_format-video":{"_last_editor_used_jetpack":["classic-editor"],"_edit_lock":["1614869341:2"],"_edit_last":["2"],"_wpml_media_featured":["1"],"_wpml_media_duplicate":["1"],"_yoast_wpseo_content_score":["30"],"_yoast_wpseo_estimated-reading-time-minutes":["4"],"views":["1197"],"_syntaxhighlighter_encoded":["1"],"_thumbnail_id":["10768"],"_yoast_wpseo_primary_category":["952"],"_encloseme":["1"],"_wpas_done_all":["1"],"_jetpack_related_posts_cache":["a:1:{s:32:\"8f6677c9d6b0f903e98ad32ec61f8deb\";a:2:{s:7:\"expires\";i:1614925652;s:7:\"payload\";a:3:{i:0;a:1:{s:2:\"id\";i:5049;}i:1;a:1:{s:2:\"id\";i:10656;}i:2;a:1:{s:2:\"id\";i:5040;}}}}"],"post_views_count":["583"],"mashsb_timestamp":["1674418146"],"mashsb_shares":["0"],"mashsb_jsonshares":["{\"total\":0,\"error\":{\"facebook_error\":\"\"},\"facebook_total\":0}"]},"_links":{"self":[{"href":"https:\/\/techmoz.net\/en\/wp-json\/wp\/v2\/posts\/10762","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techmoz.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techmoz.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techmoz.net\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/techmoz.net\/en\/wp-json\/wp\/v2\/comments?post=10762"}],"version-history":[{"count":6,"href":"https:\/\/techmoz.net\/en\/wp-json\/wp\/v2\/posts\/10762\/revisions"}],"predecessor-version":[{"id":10770,"href":"https:\/\/techmoz.net\/en\/wp-json\/wp\/v2\/posts\/10762\/revisions\/10770"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techmoz.net\/en\/wp-json\/wp\/v2\/media\/10768"}],"wp:attachment":[{"href":"https:\/\/techmoz.net\/en\/wp-json\/wp\/v2\/media?parent=10762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techmoz.net\/en\/wp-json\/wp\/v2\/categories?post=10762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techmoz.net\/en\/wp-json\/wp\/v2\/tags?post=10762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}