O'Reilly logo

Refactoring to Patterns by Joshua Kerievsky

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 11. Utilities

The refactorings in this section are low-level transformations used by the higher-level refactorings in the catalog. These refactorings fit well with the refactorings in Refactoring [F].

Chain Constructors (340) is about removing duplication in constructors by having them call each other. This refactoring is used by the refactoring Replace Constructors with Creation Methods (57).

Unify Interfaces (343) is useful when you need a superclass and/or interface to share the same interface as a subclass. The usual motivation for applying this refactoring is to make it possible to treat objects polymorphically. The refactorings Move Embellishment to Decorator (144) and Move Accumulation to Visitor (320) both make use of this refactoring. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required