What is Open-closed Principle?

 v Open-Closed Principle (OCP) states that software entities(classes, modules) should be open for extension, but closed for modification.

 
v Open-Closed Principle (OCP) states that software entities(classes, modules) should be open for extension, but closed for modification.

v SRP is the prerequisite for OCP.

v The benefit is simple testing is required to test individual classes, but if you will keep on adding and modifying in one class. Then even for the smallest modification, the whole class needs to be tested.

 


Post a Comment

Previous Post Next Post