9. The Open/Closed Principle (OCP)
© Jennifer M. Kohnke
Dutch Door: Noun. A door divided in two horizontally so that either part can be left open or closed.
—The American Heritage Dictionary of the English Language, Fourth Edition, 2000
As Ivar Jacobson has said, “All systems change during their life cycles. This must be borne in mind when developing systems expected to last longer than the first version.”1 How can we create designs that are stable in the face of change and that will last longer than the first version? Bertrand Meyer2 gave us guidance as long ago as 1988 when he coined the now-famous open/closed principle. To paraphrase him: ...