[O] The Open-Closed Principle
- 3/1/2023
- Reading time . 2 min
- Author: Yuniel Acosta
![[O] The Open-Closed Principle](/_astro/open-closed-principle_1kPFSj.png)
This article explains the Open-Closed Principle (OCP) of SOLID design, which advises creating flexible and maintainable code by keeping classes open to extension but closed to modification. It uses an example to show how to adhere to the OCP by defining an interface and creating separate classes for each shape. Read more โ