Design Patterns Explained: A New Perspective on Object-Oriented Design
by Alan Shalloway, James R. Trott
The Open-Closed Principle
Software clearly needs to be extensible. However, making changes to software runs the risk of introducing problems. This dilemma led Bertrand Meyer to propose the open-closed principle.[1] To paraphrase this principle, the modules, methods, and classes should be open for extension, while closed for modification.[2] In other words, we must design our software so that we can extend the capabilities of our software without changing it.
[1] Meyer, B., Object-Oriented Software Construction, Upper Saddle River, N.J.: Prentice Hall, 1997, p. 57.
[2] See this book's Web site for a link to “The Open-Closed Principle,” an excellent article by Robert C. Martin. Go to http://www.netobjectives.com/dpexplained.
As contradictory as this ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access