Skip to content

Latest commit

 

History

History

OCP

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

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.