June 2019
Beginner to intermediate
770 pages
19h 24m
English
The Dependency Inversion Principle (DIP) has an unfortunate name; the word inversion seems to imply there's some kind of obvious dependency and we should invert the obvious dependency rules. Practically, the principle is described as having class dependencies based on the most abstract superclass possible, not on a specific, concrete implementation class.
In languages with formal type declarations, for example, Java or C++, this advice to refer to abstract superclasses can be helpful to avoid complex recompiles for small changes. These languages also need fairly complex dependency injection frameworks to be sure that classes can be altered via runtime configuration changes. In Python, the runtime flexibility ...
Read now
Unlock full access