Design Patterns · Junior · Question 27 of 75

What does the Open/Closed Principle (OCP) mean?

Explanation

New behavior is added without rewriting proven code: via a new strategy, a plugin, or a component through props/children. Example: a Button with an icon prop instead of editing the button for every new icon.

Further reading

Problem with a question

Design Patterns · Junior · question 27

Test yourself

Take the Design Patterns · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz