Definition : The SOLID principles are a set of five design principles in object-oriented programming that help developers create more maintainable, understandable, and flexible software. These principles were introduced by Robert C. Martin, also known as Uncle Bob.
| S | - | Single Responsibility Principle (SRP) |
| O | - | Open/Closed Principle (OCP) |
| L | - | Liskov Substitution Principle (LSP) |
| I | - | Interface Segregation Principle (ISP) |
| D | - | Dependency Inversion Principle (DIP) |
Definition : The Single Responsibility Principle states that a class should have only one reason to change, meaning it should have only one responsibility.
Definition : The Open/Closed Principle states that software entities should be open for extension but closed for modification.
Definition : The Liskov Substitution Principle states that objects of a superclass should be replaceable with objects of a subclass without affecting the correctness of the program.
Definition : The Interface Segregation Principle states that no client should be forced to depend on methods it does not use. Instead of one large interface, many smaller and more specific interfaces are preferred.
Definition : The Dependency Inversion Principle states that high-level modules should not depend on low-level modules. Both should depend on abstractions.