SOLID Principles

Updated Nov 13, 2025

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:

  1. Single Responsibility Principle (SRP):
    A class should have only one reason to change, meaning it should only have one job or responsibility.

  2. Open/Closed Principle (OCP):
    Software entities should be open for extension but closed for modification, allowing behavior to be added without changing existing code.

  3. Liskov Substitution Principle (LSP):
    Subtypes must be substitutable for their base types without altering the correctness of the program.

  4. 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.

  5. Dependency Inversion Principle (DIP):
    High-level modules should not depend on low-level modules; both should depend on abstractions.