June 1999
Intermediate to advanced
464 pages
10h 55m
English
Generalization produces its own batch of refactorings, mostly dealing with moving methods around a hierarchy of inheritance. Pull Up Field (320) and Pull Up Method (322) both promote function up a hierarchy, and Push Down Method (328) and Push Down Field (329) push function downward. Constructors are a little bit more awkward to pull up, so Pull Up Constructor Body (325) deals with those issues. Rather than pushing down a constructor, it is often useful to use Replace Constructor with Factory Method (304).
If you have methods that have a similar outline body but vary in details, you can use Form Template Method (345) to separate the differences from the similarities.
In addition to moving function around ...
Read now
Unlock full access