Open/closed design principle states “software entities (classes,
modules, functions, etc.) should be open for extension, but closed
for modification”.
Open/closed principle term was originated by Bertrand Meyer in
his book Object Oriented Software Construction.
As per this principle, if a module is available for extension then it
is considered open. If a module is available for use by other
modules then it is considered closed.
Further Robert C. Martin has mentioned it as O in SOLID principles
of Object Oriented design.
It is used in State and Strategy design patterns. Context class is
closed for modification. But new functionality can be added by
writing new strategy code