SOLID principles explained
SOLID Principles Explained
Single Responsibility Principle (SRP)
A class should have only one reason to change. It means that a class should have only one job or responsibility.
Open/Closed Principle (OCP)
Software entities (classes, modules, functions, etc.) should be open for extension but closed for modification. It means that you should be able to extend a class's behavior without modifying it.
Liskov Substitution Principle (LSP)
Subtypes must be substitutable for their base types. In other words, objects of a superclass should be replaceable with objects of its subclasses without affecting the correctness of the program.
Interface Segregation Principle (ISP)
A client should not be forced to implement interfaces it doesn't use. It means that interfaces should be specific to the needs of the clients that use them.
Dependency Inversion Principle (DIP)
High-level modules should not depend on low-level modules. Both should depend on abstractions. Abstractions should not depend on details. Details should depend on abstractions. It means that you should depend on abstractions rather than concrete implementations.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home