Chapter 11. Refactor to the Open-Closed

Solving tricky problems can often involve changing your point of view. In this chapter, we’ll examine one particularly tricky problem: how to avoid overdesign without suffering the problems that often accompany an insufficient or naïve design. In the process, we’ll rethink two, hopefully well-known, aspects of development: the Open-Closed principle and the discipline of refactoring. We’ll begin by examining these aspects as they are traditionally understood and then repurpose them in a more agile way.

The Open-Closed Principle

The notion that systems have to accommodate change is not a new one. At the birth of objects and OO, Ivar Jacobsen said, “All systems change during their life cycles. This must be ...

Get Essential Skills for the Agile Developer: A Guide to Better Programming and Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.