August 2018
Beginner
594 pages
22h 33m
English
The Open/Closed Principle (OCP) states that software components, such as classes, should be open for extension but closed for modification. When requirements change, the design should minimize the amount of changes that need to occur on existing code. We should be able to extend a component by adding new code without having to modify existing code that already works.
When Dr. Bertrand Meyer first came up with the principle in his book Object Oriented Software Construction, it focused on using implementation inheritance as the solution. If new functionality is needed, a new subtype is created and the base class and any existing subtypes could remain unchanged.
Software engineer Robert C. Martin, popularly known ...