Agile Joe (Joe Ocampo) has a good post on the ‘Open Closed Principle’:
“The open closed principle is one of the oldest principles of Object Oriented Design. I wonâ€™t bore you with the history since you can find countless articles out on the net. But if you want a really comprehensive read please checkout Robert Martinâ€™s excellent write up on the subject.
The open closed principle can be summoned up in the following statement.
open/closed principle states “software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification”; that is, such an entity can allow its behavior to be modified without altering its source code.
Sounds easy enough but many developers seem to miss the mark on actually implementing this simple extensible approach. I donâ€™t think it is a matter of skill set as much as I feel that they have never been taught how to approach applying OCP to class design.”