In object-oriented programming, the dependency inversion principle refers to a specific form of decoupling where conventional dependency relationships established from high-level, policy-setting modules to low-level, dependency modules are inverted (i.e. reversed) for the purpose of rendering high-level modules independent of the low-level module implementation details. The principle states:
-
- 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.
The principle inverts the way some people may think about object-oriented design, as both high- and low-level objects depend on the same abstraction.
Read more about Dependency Inversion Principle: Description, History
Famous quotes containing the words dependency and/or principle:
“The history of work has been, in part, the history of the workers body. Production depended on what the body could accomplish with strength and skill. Techniques that improve output have been driven by a general desire to decrease the pain of labor as well as by employers intentions to escape dependency upon that knowledge which only the sentient laboring body could provide.”
—Shoshana Zuboff (b. 1951)
“All Protestantism, even the most cold and passive, is a sort of dissent. But the religion most prevalent in our northern colonies is a refinement on the principle of resistance; it is the dissidence of dissent, and the Protestantism of the Protestant religion.”
—Edmund Burke (17291797)