Glossary: Software Design Patterns
OCP
Also written: open/closed principle, open/closed
The SOLID principle that code should be open for extension but closed for modification. You add a new rule class instead of editing `apply_discount`.
Glossary: Software Design Patterns
Also written: open/closed principle, open/closed
The SOLID principle that code should be open for extension but closed for modification. You add a new rule class instead of editing `apply_discount`.