January 16, 2014

Open / Closed Principle

Definition: An object should be open for extension but closed for modification.

This principle states that code should only be modified to fix bugs and errors, and to extend the functionality a new class should be used. Typically the new class would be a derived class to enable code re-use from the original or a common base class. This principle naturally leads to writing abstract base classes and extending functionality by writing new sub classes.

Further reading:

Bertrand Meyer

Simon Powers

Simon Powers is an Agile Coach specialising in large scale transformations and agile adoption. He has a background in very large enterprise architecture which has led on to organisational design and agile process refinement. Simon is the founder of Adventures with Agile.