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:
“Fate forces its way to the powerful and violent. With subservient obedience it will assume for years dependency on one individual: Caesar, Alexander, Napoleon, because it loves the elemental human being who grows to resemble it, the intangible element. Sometimes, and these are the most astonishing moments in world history, the thread of fate falls into the hands of a complete nobody but only for a twitching minute.”
—Stefan Zweig (18811942)
“The sons of Judah have to choose that God may again choose them.... The divine principle of our race is action, choice, resolved memory.”
—George Eliot [Mary Ann (or Marian)