SOLID principles refers to five design principles
Single Responsibility Principle (SRP) Open/Closed Principle (OCP) Liskov Substitution Principle (LSP) Interface Segregation Principle (ISP) Dependency Inversion Principle (DIP)
Single Responsibility Principle (SRP)
A class should have only one reason to change, meaning it should focus on a single responsibility.
Open/Closed Principle (OCP)
Software entities should be open for extension but closed for modification. This means that one can add more functionalities just by introducing new codes instead of altering old ones.
Liskov Substitution Principle (LSP)
Objects of a superclass should be replaceable with objects of any subclass without affecting program correctness.
Interface Segregation Principle (ISP)
No client should be forced to depend on methods it does not use. meaning it should focus on a single responsibility. This enhances the class’s clarity, testability, and maintainability.
Dependency Inversion Principle (DIP)
High-level modules should not depend on low-level modules. Both should depend on abstractions.