Single Responsibility Principle
Single Responsibility Principle
Every class should have only one responsibility.
Open-Closed Principle
Open-Closed Principle
Existing code should be modified as little as possible during maintenance, and it should be easy to extend.
Liskov Substitution Principle
Liskov Substitution Principle
Objects must be replaceable with instances of their subtypes without breaking the program’s correctness. This means that inheritance must function properly without issues.
Interface Segregation Principle
Interface Segregation Principle
Create multiple specific interfaces instead of a single general interface
Dependency Inversion Principle
Dependency Inversion Principle
The upper layer should be independent of changes in the lower layer; to avoid being affected by elements that change more frequently than itself, a superclass or abstract interface should be used.