SOLID: The Open–Closed Principle (OCP)

🖋️ This article is one part of my series on Robert (Bob) C. Martin's SOLID principles. The O in Bob's SOLID principles is in fact the brilliant Bertrand Meyer 's open–closed principle, which is one of the five principles Meyer devised to define modularity. Definition The original definition, in Bertrand Meyer's 1988 book Object-Oriented Software Construction (from my 1997 second edition): Modules…