Dependency Inversion Principlefleeting
- External reference: https://en.wikipedia.org/wiki/Dependency_inversion_principle
High-level modules should not import anything from low-level modules. Both should depend on abstractions (e.g., interfaces).Abstractions should not depend on details. Details (concrete implementations) should depend on abstractions
By dictating that both high-level and low-level objects must depend on the same abstraction, this design principle inverts the way some people may think about object-oriented programming
on the design of the high-level module, but also on the low-level one: the low-level one should be designed with the interaction in mind and it may be necessary to change its usage interface.
the “inversion” concept does not mean that lower-level layers depend on higher-level layers directly. Both layers should depend on abstractions (interfaces) that expose the behavior needed by higher-level layers