Dependency Inversion Principle
From JholJhapata
The Dependency Inversion Principle states that:
- High-level modules should not depend on low-level modules. Both should depend on abstractions.
- Abstractions should not depend on details. Details should depend on abstractions.
Dependency inversion principle is one on which most of the design patterns are build upon. It's aim is to reduce the coupling between the classes is achieved by introducing abstraction between the layer, thus doesn’t care about the real implementation.