11. The Dependency-Inversion Principle (DIP)

image

© Jennifer M. Kohnke

Nevermore Let the great interests of the State depend Upon the thousand chances that may sway A piece of human frailty

—Sir Thomas Noon Talfourd (1795–1854)

The Dependency-Inversion Principle

A. High-level modules should not depend on low-level modules. Both should depend on abstractions.

B. Abstractions should not depend upon details. Details should depend upon abstractions.

Over the years, many have questioned why I use the word inversion in the name of this principle. The reason is that more traditional software development methods, such as structured analysis and design, ...

Get Agile Principles, Patterns, and Practices in C# now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.