Depend on Abstractions, Not on Concrete Implementations The Dependency Inversion Principle (DIP), the fifth and final principle of SOLID, states that: “High-level modules should not[…]
Many Small Interfaces Instead of One Large Interface The Interface Segregation Principle (ISP) states that no class should be forced to implement methods that it[…]
A Subclass Must Be a Replaceable Substitute for Its Base Class The Liskov Substitution Principle (LSP) states that objects of a derived class should be[…]
Open for Extension, Closed for Modification Definition The Open/Closed Principle (OCP) states that software entities (such as classes, modules, or functions) should be open for[…]
One Class — One Reason to Change The Single Responsibility Principle (SRP) states that a class should have only one reason to change. “A class[…]