Skip to main content

2 docs tagged with "open-closed"

View all tags

Chapter 8: OCP — The Open-Closed Principle

A software artifact should be open for extension but closed for modification. OCP is the architectural goal that drives Clean Architecture: protect high-level policy from changes in low-level details by controlling the direction of dependencies.

Open/Closed Principle

Your class should be: - **Open for extension** → You can add new behavior - **Closed for modification** → You don't change existing, working code