- S - Single Responsibility - Each class should have only one sole purpose, and not be filled with the excessive functionality.
- O - Open-Close - Classes should be open for extension, closed for modification. In other words , you should not have to rewrite an existing class for implementing new features.
- L - Liskov Substitution - This means that every subclass or derived class should be substitutable for their base or parent class.
- I - Interface Segregation - Interfaces should not force classes to implement what they can't do . Large interfaces should be divided into small ones.
- D - Dependency Inversion (Injection) - Components should depend on abstractions, not on concretions.
Q: Why we should consider them when designing software?
A: Design principles encourage us to create more maintainable, understandable, and flexible software.
Reference: