User Tools

Site Tools


principles:dependency_inversion_principle

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
principles:dependency_inversion_principle [2013-04-03 14:22] – [Evidence] christianprinciples:dependency_inversion_principle [2021-09-02 19:24] – old revision restored (2021-05-11 21:48) 65.21.179.175
Line 10: Line 10:
  
 ===== Principle Statement ===== ===== Principle Statement =====
- 
-Depend on abstractions.((Robert C. Martin: //Agile Software Development, Principles, Patterns, and Practices//, p. 129)) 
  
  
Line 21: Line 19:
  
 ===== Strategies ===== ===== Strategies =====
- 
-  * Apply the [[patterns:Dependency Inversion]] Pattern 
-  * Apply other forms of [[glossary:dependency inversion]] 
-  * Have an ''interface'' type for every class 
-  * Declare only ''interface'' types so that an object variable generally has an ''interface'' as static type and a concrete class as dynamic type 
- 
- 
-===== Caveats ===== 
- 
-It is normally not helpful to apply DIP to [[patterns:value objects]]. 
- 
-Furthermore note that applying [[patterns:dependency inversion]] pattern (see [[#strategies]]) introduces an abstraction. FIXME explain Super-A vs. ReqByB 
- 
-See section [[#contrary principles]]. 
  
  
 ===== Origin ===== ===== Origin =====
- 
-Robert C. Martin: //[[http://www.objectmentor.com/resources/articles/oodmetrc.pdf|Object Oriented Design Quality Metrics: an analysis of dependencies]]// 
  
  
 ===== Evidence ===== ===== Evidence =====
 /* Comment out what is not applicable and explain the rest: */ /* Comment out what is not applicable and explain the rest: */
- +/* 
-/*  * [[wiki:Proposed]]*/ +  * [[wiki:Proposed]] 
-/*  * [[wiki:Examined]]*+  * [[wiki:Examined]] 
- +  * [[wiki:Accepted]] 
-[[wiki:Accepted]]: DIP is part of the well-know [[collections:SOLID]] principle collection. +  * [[wiki:Questioned]] 
- +*/
-/*  * [[wiki:Questioned]]*/ +
  
 ===== Relations to Other Principles ===== ===== Relations to Other Principles =====
Line 68: Line 48:
  
   * [[Model Principle]] (MP): DIP demands having abstractions. MP tells how these abstractions can look like.   * [[Model Principle]] (MP): DIP demands having abstractions. MP tells how these abstractions can look like.
 +  * [[Encapsulate the Concept that Varies]] (ECV): 
  
 ==== Principle Collections ==== ==== Principle Collections ====
Line 74: Line 55:
 {{page>collections:SOLID#Box}} {{page>collections:SOLID#Box}}
  
-===== Examples =====+===== Example =====
  
  
Line 85: Line 66:
 ===== Further Reading ===== ===== Further Reading =====
  
-  * Robert C. Martin: //[[http://www.objectmentor.com/resources/articles/oodmetrc.pdf|Object Oriented Design Quality Metrics: an analysis of dependencies]]// 
-  * Robert C. Martin: //Agile Software Development, Principles, Patterns, and Practices// 
-  * [[http://www.butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod|ButUncleBob: Principles of OOD]] 
-  * [[wiki>DependencyInversionPrinciple]] 
-  * [[wp>Dependency inversion principle]] 
  
principles/dependency_inversion_principle.txt · Last modified: 2021-10-18 21:23 by christian