SOLID Principles
The SOLID principles are a set of five design principles that help software developers create more maintainable, understandable, and flexible software systems. The principles are:
-
Single Responsibility Principle (SRP):
A class should have only one reason to change, meaning it should only have one job or responsibility. -
Open/Closed Principle (OCP):
Software entities should be open for extension but closed for modification, allowing behavior to be added without changing existing code. -
Liskov Substitution Principle (LSP):
Subtypes must be substitutable for their base types without altering the correctness of the program. -
Interface Segregation Principle (ISP):
Clients should not be forced to depend on interfaces they do not use, promoting the use of smaller, more specific interfaces. -
Dependency Inversion Principle (DIP):
High-level modules should not depend on low-level modules; both should depend on abstractions.