Skip to content

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`.

Where the book teaches it

Related terms

SOLIDPlugin