- S : Single Responsibility Principle (SRP).
- O : Open closed Principle (OSP).
- L : Liskov substitution Principle (LSP).
- I : Interface Segregation Principle (ISP).
- D : Dependency Inversion Principle (DIP).
- Software entities should be open for extension, but closed for modification.
- The design and writing of the code should be done in a way that new functionality should be added with minimum changes in the existing code.
- The design should be done in a way to allow the adding of new functionality as new classes, keeping as much as possible existing code unchanged.
See OCP1 and OCP2 folders for source code.
See OCPsolution folder for source code.