{"id":129,"date":"2025-09-28T15:10:14","date_gmt":"2025-09-28T11:10:14","guid":{"rendered":"https:\/\/abthoughts.com\/?p=129"},"modified":"2025-09-28T15:26:20","modified_gmt":"2025-09-28T11:26:20","slug":"solid-principles-dependency-inversion-dip","status":"publish","type":"post","link":"https:\/\/abthoughts.com\/?p=129","title":{"rendered":"SOLID Principles \u2013 Dependency Inversion\u00a0 \u2013 DIP"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is the Dependency Inversion Principle (DIP) in the context of SOLID principles?<\/h2>\n\n\n\n<p>The <strong>Dependency Inversion Principle (DIP)<\/strong> is all about separating high-level architecture from low-level implementation details. Which means any software component should depend on interfaces rather than concrete classes.<\/p>\n\n\n\n<div class=\"wp-block-media-text has-media-on-the-right is-stacked-on-mobile\" style=\"grid-template-columns:auto 38%\"><div class=\"wp-block-media-text__content\">\n<p><strong>Dependency Inversion Principle (DIP)<\/strong><\/p>\n\n\n\n<p>High-level modules should not depend on low-level modules.<\/p>\n\n\n\n<p><br>Both abstract and concrete modules should only depend on abstract modules.<\/p>\n\n\n\n<p>RC Martin<\/p>\n<\/div><figure class=\"wp-block-media-text__media\"><img loading=\"lazy\" decoding=\"async\" width=\"680\" height=\"626\" src=\"https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/Screenshot-2025-09-21-210448.jpg\" alt=\"\" class=\"wp-image-167 size-full\" srcset=\"https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/Screenshot-2025-09-21-210448.jpg 680w, https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/Screenshot-2025-09-21-210448-300x276.jpg 300w\" sizes=\"auto, (max-width: 680px) 100vw, 680px\" \/><\/figure><\/div>\n\n\n\n<p><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><\/p>\n<\/blockquote>\n\n\n\n<p>DIP was coined by Robert C. Martin in his 1996 paper <em>\u201c<a href=\"https:\/\/www.labri.fr\/perso\/clement\/enseignements\/ao\/DIP.pdf\">The Dependency Inversion Principle<\/a>\u201d<\/em> (published in the C++ Report), DIP encourages us to depend on abstractions (interfaces), not concrete implementations (classes).<\/p>\n\n\n\n<p>Now, this doesn\u2019t mean we avoid <em>all<\/em> concrete dependencies. For example, in Java you\u2019ll always depend on <code>String<\/code>. That\u2019s fine\u2014it\u2019s stable and rarely changes. The real danger lies in depending on volatile, work-in-progress modules that are still evolving. Those are the ones that can break your system.<\/p>\n\n\n\n<p>And remember, DIP doesn\u2019t just apply to classes. It extends to any software component\u2014interfaces, packages, jars, or DLLs. If a module exposes abstractions, you can treat it as an \u201cabstract package\u201d and safely build on top of it.<\/p>\n\n\n\n<p>A package or jar or DLL contains abstract classes can be called abstract package, while a package or jar contains concrete classes can be called concrete package. Following DIP role, concrete and abstract packages should only depend on abstract packages.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/ChatGPT-Image-Sep-21-2025-09_22_57-PM-1024x683.png\" alt=\"\" class=\"wp-image-173\" srcset=\"https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/ChatGPT-Image-Sep-21-2025-09_22_57-PM-1024x683.png 1024w, https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/ChatGPT-Image-Sep-21-2025-09_22_57-PM-300x200.png 300w, https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/ChatGPT-Image-Sep-21-2025-09_22_57-PM-768x512.png 768w, https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/ChatGPT-Image-Sep-21-2025-09_22_57-PM.png 1536w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>The most flexible systems are those in which source code dependencies refer only to abstractions, not to concretions.<\/p>\n\n\n\n<p>Robert C Martin in clean architecture book.<\/p>\n<\/blockquote>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Let\u2019s have an example on DIP<\/h2>\n\n\n\n<p>In the below diagram, we have three tightly-coupled layers: <strong>AddressControllerImpl<\/strong>, <strong>AddressServiceImpl<\/strong>, and <strong>AddressRepositoryImpl<\/strong>. The flow is simple \u2014 the controller calls the service, the service calls the repository, and finally the repository saves the address.<\/p>\n\n\n\n<p>The problem is that each layer depends directly on a <strong>concrete implementation<\/strong> rather than an abstraction. For instance, <code>AddressControllerImpl<\/code> depends on <code>AddressServiceImpl<\/code>, which in turn depends on <code>AddressRepositoryImpl<\/code>. This tight coupling makes the code harder to test, less flexible, and more fragile to changes, since swapping out one component means rewriting the layers above it.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"791\" height=\"92\" src=\"https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/DIP-3.jpg\" alt=\"\" class=\"wp-image-205\" srcset=\"https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/DIP-3.jpg 791w, https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/DIP-3-300x35.jpg 300w, https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/DIP-3-768x89.jpg 768w\" sizes=\"auto, (max-width: 791px) 100vw, 791px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>To break the tight coupling, we introduce an <strong>interface for each class<\/strong> and separate the code into <strong>abstract (interfaces)<\/strong> and <strong>concrete (implementations)<\/strong> packages. This ensures that dependencies always point to abstractions, not implementations. With this structure, the <strong>Dependency Inversion Principle<\/strong> is preserved at both the <strong>class level<\/strong> and the <strong>package level<\/strong>, making the design more flexible, testable, and maintainable.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"270\" src=\"https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/DIP-4-1024x270.jpg\" alt=\"\" class=\"wp-image-204\" srcset=\"https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/DIP-4-1024x270.jpg 1024w, https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/DIP-4-300x79.jpg 300w, https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/DIP-4-768x202.jpg 768w, https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/DIP-4.jpg 1188w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why is it Called Dependency &#8220;Inversion&#8221;?<\/h2>\n\n\n\n<p>Normally, high-level modules depend on low-level modules. DIP inverts this relationship by introducing an interface (Service) that both high-level and low-level modules depend on.<br>The Application depends on the Service interface, and the Concrete Implementation also adheres to this interface. The Service Factory resolves the dependency at runtime by providing the appropriate implementation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Why it is important to follow DIP<\/strong><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Promotes Flexibility &amp; Scalability<\/strong><br>High-level modules depend on abstractions, not concrete classes.<br><em>Example:<\/em> You can introduce a new <code>AddressRepositoryImpl<\/code> (e.g., switching from SQL to NoSQL) without touching <code>AddressService<\/code> or <code>AddressController<\/code>.<\/li>\n\n\n\n<li><strong>Improves Testability<\/strong><br>Abstractions allow easy mocking and stubbing in tests.<br><em>Example:<\/em> Replace <code>AddressRepositoryImpl<\/code> with a mock repository during unit testing, so you can test <code>AddressServiceImpl<\/code> in isolation.<\/li>\n\n\n\n<li><strong>Ensures Decoupling<\/strong><br>Business logic is shielded from infrastructure details.<br><em>Example:<\/em> <code>AddressController<\/code> focuses on the <strong>Submit<\/strong> workflow, <code>AddressService<\/code> handles the <strong>validation logic<\/strong>, and persistence is delegated to any class implementing <code>AddressRepository<\/code>. This separation keeps concerns clean and independent.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Stay Abstract Rulebook<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Don\u2019t inherit from volatile concrete classes<\/strong><br>Inheritance is a dependency \u2014 use it with caution.<\/li>\n\n\n\n<li><strong>Don\u2019t depend on volatile concrete classes<\/strong><br>Always depend on abstractions (interfaces).<\/li>\n\n\n\n<li><strong>Don\u2019t override concrete functions<\/strong><br>Concrete functions often drag hidden dependencies. Instead, design them as abstract from the start and provide multiple implementations.<\/li>\n\n\n\n<li><strong>Avoid concrete and volatile references<\/strong><br>Never mention the name of a concrete class directly in your code.<\/li>\n\n\n\n<li><strong>Use proper creation patterns<\/strong><br>When instantiating a concrete class, prefer Dependency Injection or an Abstract Factory.<\/li>\n\n\n\n<li><strong>Execution flow clarity<\/strong><br>The client should depend on the <strong>service interface<\/strong>, not directly on its implementation, to perform tasks.<\/li>\n<\/ol>\n\n\n\n<p><\/p>\n\n\n\n<p>In <strong>Dependency Inversion<\/strong>, the <strong>client depends on the service interface<\/strong>, not on a concrete implementation. The <strong>service implementation<\/strong> then depends on the same interface by implementing it. This way, both the client and the implementation depend on an abstraction, which is the essence of dependency inversion.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"644\" height=\"62\" src=\"https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/DIP-2.jpg\" alt=\"\" class=\"wp-image-202\" srcset=\"https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/DIP-2.jpg 644w, https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/DIP-2-300x29.jpg 300w\" sizes=\"auto, (max-width: 644px) 100vw, 644px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">What is abstract factory?<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"558\" height=\"264\" src=\"https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/DIP.jpg\" alt=\"\" class=\"wp-image-200\" srcset=\"https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/DIP.jpg 558w, https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/DIP-300x142.jpg 300w\" sizes=\"auto, (max-width: 558px) 100vw, 558px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>The <strong>Abstract Factory pattern<\/strong> ensures an application depends only on abstractions, not concrete implementations. In the diagram, the <strong>Application<\/strong> stays on the abstraction side of the dependency boundary, knowing only two contracts: <strong>ServiceFactory<\/strong> (to create services) and <strong>Service<\/strong> (to execute business logic). It never touches the implementations.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>From the Application\u2019s view: it <em>has a ServiceFactory<\/em> to request services and <em>has a Service<\/em> to perform work.<\/li>\n\n\n\n<li>On the other side, concrete classes do the work: <em>ServiceFactoryImpl is a ServiceFactory<\/em>, <em>ServiceImpl is a Service<\/em>, and <em>ServiceFactoryImpl has a ServiceImpl<\/em> to create and wire the service.<\/li>\n<\/ul>\n\n\n\n<p>All dependencies flow in one direction \u2014 from the concrete side to the abstract side. This keeps the Application independent of details, making the system flexible, testable, and resilient to change.<\/p>\n\n\n\n<p><strong>Note<\/strong>: the service factory implementation depending on the service implementation. That is fine because bit is isolated from the system and nobody now will access the service implementation directly and it is refrenced in one concrete component (serviceFactory).<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Summary: Dependency Inversion Principle (DIP)<\/strong><\/h2>\n\n\n\n<p>The <strong>Dependency Inversion Principle (DIP)<\/strong>, introduced by Robert C. Martin, ensures high-level modules depend on abstractions, not concrete implementations. By introducing interfaces and separating code into abstract and concrete packages, systems avoid tight coupling, gain flexibility, and become easier to test.<\/p>\n\n\n\n<p>DIP inverts the usual flow: both high-level and low-level modules depend on abstractions, while concrete classes are resolved at runtime through factories or dependency injection. This makes applications more scalable, maintainable, and resilient to change. The <strong>Abstract Factory pattern<\/strong> illustrates this by keeping the Application dependent only on contracts, never on implementation details.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is the Dependency Inversion Principle (DIP) in the context of SOLID principles? The Dependency Inversion Principle (DIP)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,7],"tags":[],"class_list":["post-129","post","type-post","status-publish","format-standard","hentry","category-solid","category-system-design"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SOLID Principles \u2013 Dependency Inversion\u00a0 \u2013 DIP - ABthoughts<\/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:\/\/abthoughts.com\/?p=129\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SOLID Principles \u2013 Dependency Inversion\u00a0 \u2013 DIP - ABthoughts\" \/>\n<meta property=\"og:description\" content=\"What is the Dependency Inversion Principle (DIP) in the context of SOLID principles? The Dependency Inversion Principle (DIP)\" \/>\n<meta property=\"og:url\" content=\"https:\/\/abthoughts.com\/?p=129\" \/>\n<meta property=\"og:site_name\" content=\"ABthoughts\" \/>\n<meta property=\"article:published_time\" content=\"2025-09-28T11:10:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-28T11:26:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/Screenshot-2025-09-21-210448.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"680\" \/>\n\t<meta property=\"og:image:height\" content=\"626\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Abdelrahman Fathy Bassiouny\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Abdelrahman Fathy Bassiouny\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/abthoughts.com\/?p=129\",\"url\":\"https:\/\/abthoughts.com\/?p=129\",\"name\":\"SOLID Principles \u2013 Dependency Inversion\u00a0 \u2013 DIP - ABthoughts\",\"isPartOf\":{\"@id\":\"https:\/\/abthoughts.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/abthoughts.com\/?p=129#primaryimage\"},\"image\":{\"@id\":\"https:\/\/abthoughts.com\/?p=129#primaryimage\"},\"thumbnailUrl\":\"https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/Screenshot-2025-09-21-210448.jpg\",\"datePublished\":\"2025-09-28T11:10:14+00:00\",\"dateModified\":\"2025-09-28T11:26:20+00:00\",\"author\":{\"@id\":\"https:\/\/abthoughts.com\/#\/schema\/person\/2b4a7aed9d893435d974f7c1205df9e6\"},\"breadcrumb\":{\"@id\":\"https:\/\/abthoughts.com\/?p=129#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/abthoughts.com\/?p=129\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/abthoughts.com\/?p=129#primaryimage\",\"url\":\"https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/Screenshot-2025-09-21-210448.jpg\",\"contentUrl\":\"https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/Screenshot-2025-09-21-210448.jpg\",\"width\":680,\"height\":626},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/abthoughts.com\/?p=129#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/abthoughts.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SOLID Principles \u2013 Dependency Inversion\u00a0 \u2013 DIP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/abthoughts.com\/#website\",\"url\":\"https:\/\/abthoughts.com\/\",\"name\":\"ABthoughts\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/abthoughts.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/abthoughts.com\/#\/schema\/person\/2b4a7aed9d893435d974f7c1205df9e6\",\"name\":\"Abdelrahman Fathy Bassiouny\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/abthoughts.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/bcf8cb261478ad1011536386498157a3d506f31ae253acdb83591046974c192f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/bcf8cb261478ad1011536386498157a3d506f31ae253acdb83591046974c192f?s=96&d=mm&r=g\",\"caption\":\"Abdelrahman Fathy Bassiouny\"},\"sameAs\":[\"http:\/\/abthoughts.com\",\"https:\/\/www.linkedin.com\/in\/abdelrahman-fathy-43a14553\"],\"url\":\"https:\/\/abthoughts.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SOLID Principles \u2013 Dependency Inversion\u00a0 \u2013 DIP - ABthoughts","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:\/\/abthoughts.com\/?p=129","og_locale":"en_US","og_type":"article","og_title":"SOLID Principles \u2013 Dependency Inversion\u00a0 \u2013 DIP - ABthoughts","og_description":"What is the Dependency Inversion Principle (DIP) in the context of SOLID principles? The Dependency Inversion Principle (DIP)","og_url":"https:\/\/abthoughts.com\/?p=129","og_site_name":"ABthoughts","article_published_time":"2025-09-28T11:10:14+00:00","article_modified_time":"2025-09-28T11:26:20+00:00","og_image":[{"width":680,"height":626,"url":"https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/Screenshot-2025-09-21-210448.jpg","type":"image\/jpeg"}],"author":"Abdelrahman Fathy Bassiouny","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Abdelrahman Fathy Bassiouny","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/abthoughts.com\/?p=129","url":"https:\/\/abthoughts.com\/?p=129","name":"SOLID Principles \u2013 Dependency Inversion\u00a0 \u2013 DIP - ABthoughts","isPartOf":{"@id":"https:\/\/abthoughts.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/abthoughts.com\/?p=129#primaryimage"},"image":{"@id":"https:\/\/abthoughts.com\/?p=129#primaryimage"},"thumbnailUrl":"https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/Screenshot-2025-09-21-210448.jpg","datePublished":"2025-09-28T11:10:14+00:00","dateModified":"2025-09-28T11:26:20+00:00","author":{"@id":"https:\/\/abthoughts.com\/#\/schema\/person\/2b4a7aed9d893435d974f7c1205df9e6"},"breadcrumb":{"@id":"https:\/\/abthoughts.com\/?p=129#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/abthoughts.com\/?p=129"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/abthoughts.com\/?p=129#primaryimage","url":"https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/Screenshot-2025-09-21-210448.jpg","contentUrl":"https:\/\/abthoughts.com\/wp-content\/uploads\/2025\/09\/Screenshot-2025-09-21-210448.jpg","width":680,"height":626},{"@type":"BreadcrumbList","@id":"https:\/\/abthoughts.com\/?p=129#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/abthoughts.com\/"},{"@type":"ListItem","position":2,"name":"SOLID Principles \u2013 Dependency Inversion\u00a0 \u2013 DIP"}]},{"@type":"WebSite","@id":"https:\/\/abthoughts.com\/#website","url":"https:\/\/abthoughts.com\/","name":"ABthoughts","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/abthoughts.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/abthoughts.com\/#\/schema\/person\/2b4a7aed9d893435d974f7c1205df9e6","name":"Abdelrahman Fathy Bassiouny","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/abthoughts.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/bcf8cb261478ad1011536386498157a3d506f31ae253acdb83591046974c192f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bcf8cb261478ad1011536386498157a3d506f31ae253acdb83591046974c192f?s=96&d=mm&r=g","caption":"Abdelrahman Fathy Bassiouny"},"sameAs":["http:\/\/abthoughts.com","https:\/\/www.linkedin.com\/in\/abdelrahman-fathy-43a14553"],"url":"https:\/\/abthoughts.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/abthoughts.com\/index.php?rest_route=\/wp\/v2\/posts\/129","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/abthoughts.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/abthoughts.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/abthoughts.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/abthoughts.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=129"}],"version-history":[{"count":38,"href":"https:\/\/abthoughts.com\/index.php?rest_route=\/wp\/v2\/posts\/129\/revisions"}],"predecessor-version":[{"id":210,"href":"https:\/\/abthoughts.com\/index.php?rest_route=\/wp\/v2\/posts\/129\/revisions\/210"}],"wp:attachment":[{"href":"https:\/\/abthoughts.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=129"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/abthoughts.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=129"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/abthoughts.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=129"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}