Skip to content

Latest commit

 

History

History
18 lines (15 loc) · 798 Bytes

README.md

File metadata and controls

18 lines (15 loc) · 798 Bytes

Open/Closed Principle

Acronym

  • 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).

Open/Closed Principle:

  1. Software entities should be open for extension, but closed for modification.
  2. 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.
  3. 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.

How not to do it

See OCP1 and OCP2 folders for source code.

How to do it

See OCPsolution folder for source code.