SOLID Principles:
SOLID are five basic principles whichhelp to create good software architecture. SOLID is an acronym where:-
- S stands for SRP (Single responsibility principle )
- O stands for OCP (Open closed principle)
- L stands for LSP (Liskov substitution principle)
- I stands for ISP ( Interface segregation principle)
- D stands for DIP ( Dependency inversion principle)
SRP
OCP
Software should be open for extension, but closed for modification.
LSP
LSP
Objects in a program should be replaceable with instances of their subtypes without altering the correctness of
that program
ISP
No client should be forced to depend on methods it does not use.
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.
ISP
No client should be forced to depend on methods it does not use.
Many client-specific interfaces are better than one general-purpose interface.
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.
No comments:
Post a Comment