Dependency Inversion Principle
Previously, we learned about OCP (Open/Closed Principle) and LSP (Liskov Substitution Principle). OCP is the principle of allowing changes but preventing modifications, and LSP is the principle that a base class can be replaced by its subclass. Here, I will talk about the structure that arises from strictly applying these two principles. This structure itself becomes a principle, and its name is the Dependency Inversion Principle. What’s Wrong with Software? As developers, we often drive ourselves into bad design. Why does this happen? The core of the problem is that we haven’t defined what bad design is. ...