The first five principles are principles of class design. They are :
SRP | The Single Responsiblity Principle | “A class should have one, and only, one reason to change.“ |
---|---|---|
OCP | The Open Closed Principle | You shloud be able to extend a classes behavior, without modifying it. |
LSP | The Liskov Substitution Principle | Derived classes must be substitutable for their base classes. |
ISP | The Interface Segeregation Principle | Make fine grained interfaces that are client specific. |
DIP | The Dependency Inversion Principle | Depend on abstraction, not on concretions. |
추가 설명
OCP - Software entities (classes, modules, etc) should be open for extension, but closed for modification.
LSP - Derived classes must usable through the base class interface without the need for the user to know the difference
DIP
A. High-level modules should not depend on low-level modules. Both should depend on abstractions.
B. Abstractions should not depend on details. Details should depend on abstractions.
The next six principles are about packages.
The first three package principles are about package cohesion, they tell us what to put inside packages:
REP | The Release Reuse Equivalency Principle | The granule of reuse is the granule of release. |
---|---|---|
CCP | The Common Closure Principle | classes that change together are packaged together. |
CRP | The Common Reuse Principle | classes that are used together are packaged toghether. |
추가 설명