Dependency Inversion And Xp

(DIP) The DependencyInversionPrinciple [which see].

One of the PrinciplesOfObjectOrientedDesign.

A fundamental principle of object oriented design that states concrete classes should not be directly depended upon. That rather, the bulk of the code in the system should depend only upon the interfaces that those concrete classes implement.

See and the other papers in the publications section of

-- RobertCecilMartin - 9/7/99

Note, this was early in his ExtremeProgramming days. Since then, he has refined his position to include RefactorMercilessly, where "invert" is a transitive verb.

He always defines OO decoupling as equivalent to the DependencyInversionPrinciple over PolymorphicInterface?s, continuously through 2008.

Under ExtremeProgramming, if you do indeed plan to invert, you can write tests and perform refactors that lead simple code to the inversion. And if you don't plan to invert, but discover you then need an inversion, you will have the UnitTests, PairProgramming, and ContinuousIntegration available to assist the inversion.

And some RefactoringBrowsers will help automate it, with commands like ExtractInterfaceClass?.

XP allows you to avoid the high risk of thinking of too many abstractions ahead of time. Architecture evolves, via EmergentDesign, leaving room for just the right mix of patterns, architecture and principles.

Suggested reading:

CategoryModelingLawsAndPrinciples CategoryExtremeProgramming

View edit of December 11, 2011 or FindPage with title or text search