Design Principles provides ways to overcome most of the software design problems. SOLID principles are complied by Robert C. Martin in the 1909s. These principles provide us to move from tightly coupled code to loosely coupled code and encapsulate real needs of business properly. SOLID is acronym for following:
- S: Single Responsibility Principle (SRP) - Every software module should have only one reason to change.
- O: Open Closed Principle (OCP) - A software module/class is open for extension and closed for modification.
- L: Liskov's Substitution Principle (LSP) - A derived class (sub class) must be substituted for it's base class (parent class).
- I: Interface Segregation Principle (ISP) - The clients should not be forced to implement interfaces they don't use. Instead of one fat interface many small interfaces are preferred based on groups of methods, each one serving one sub module.
- D: Dependency Inversion Principle (DIP) - The high-level modules/classes should not depend upon low-level modules/classes. Both should depend upon abstractions. Secondly, abstractions should not depend upon details. Details should depend upon abstractions.
No comments:
Post a Comment