Skip to content

Glossary: Software Design Patterns in C++

Open/closed principle

Also written: OCP, open for extension, closed for modification

The O in SOLID: code should be open for extension but closed for modification, so you add behavior with new code instead of editing old code. A new `Fall15` rule is a new class plus one `push_back`.

Where the book teaches it

Related terms

SOLIDStrategy