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)
“Now, what I want is, Facts. Teach these boys and girls nothing but Facts. Facts alone are wanted in life. Plant nothing else, and root out everything else. You can only form the minds of reasoning animals upon Facts: nothing else will ever be of any service to them. This is the principle on which I bring up my own children, and this is the principle on which I bring up these children. Stick to Facts, sir!”
—Charles Dickens (18121870)