C H A P T E R  12

image

Simplifying Generalization Relationships

With the generalization methods we want to introduce order and clarity in class hierarchies. There are methods that deal with moving class features in hierarchy to the subclass or to the super class (pull up/down attributes, pull up/down method), there is a method that takes care of standardizing the constructor and extracts it on the super class (pull up constructor body), and another very interesting method that helps us to implement the template method pattern of “Gang of Four”[GOF], which is useful when we have methods that perform the same steps but the steps are different.

We will ...

Get Pro PHP Refactoring 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.