Background I've been to a few talks on SOLID before. Most of the principles seem pretty reasonable to me – but I've never "got" the open-closed principle (OCP from here on). At CodeMash this year, I mentioned this to the wonderful Cori Drew, who said that she'd been at a user group talk where she…
In the Beginning... ...there was no inheritance and no composition, only code. And the code was unwieldy, repetitive, blocky, unhappy, verbose, and tired. Copy and Paste were the primary mechanisms of code reuse. Procedures and functions were rare, newfangled gadgets viewed with suspicion. Calling a procedure was expensive! Separating pieces of code from the main logic caused confusion! It was a Dark Time.
In the Beginning... ...there was no inheritance and no composition, only code. And the code was unwieldy, repetitive, blocky, unhappy, verbose, and tired. Copy and Paste were the primary mechanisms of code reuse. Procedures and functions were rare, newfangled gadgets viewed with suspicion. Calling a procedure was expensive! Separating pieces of code from the main logic caused confusion! It was a Dark Time.
M. Stevens, A. Kellens, J. Brichau, and T. D'Hondt. BENEVOL 2007 - 6th BElgian-NEtherlands software eVOLution workshop (Namur, Belgium, December 13-14, 2007), (2007)
R. Godin, and P. Valtchev. Formal Concept Analysis: Foundations and
Applications, volume 3626 of Lecture Notes in Computer Science, Springer, Berlin/Heidelberg, (2005)
I. Kurtev, J. Bézivin, F. Jouault, and P. Valduriez. OOPSLA '06: Companion to the 21st ACM SIGPLAN Symposium on Object-oriented Programming Systems, Languages, and Applications, Portland, OR, USA, page 602-616. (2006)