Chapter 11.  Utilities

Prev don't be afraid of buying books Next

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.

Extract Parameter (346) is useful when a field is assigned to a locally instantiated value and you'd rather have that value supplied by a parameter. While this can be useful in many situations, the refactoring Move Embellishment to Decorator (144) uses this refactoring just after the application of Replace Inheritance with Delegation [F].


Refactoring to Patterns (The Addison-Wesley Signature Series)
Refactoring to Patterns
ISBN: 0321213351
EAN: 2147483647
Year: 2003
Pages: 103

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: