Open-Closed Principle
← Back to SOLID Principles
Open for extension, closed for modification. Software entities should allow their behavior to be extended without modifying their existing source code, typically achieved through abstraction and polymorphism.
Key Properties
Related
- Strategy (pattern implementing OCP)
- Polymorphism (mechanism for OCP)
- Decorator (extends behavior without modification)