Extract Superclass
From CSSEMediaWiki
Revision as of 21:44, 14 October 2009 by Brett Ward (Talk | contribs)
If two classes have similar features it may be appropriate to create a superclass and move the common features to that. This will reduce the amount of duplicate code, making it easier to alter the similar functionalities in the future.
An alternative to this is Extract Class. As with other refactorings, if a wrong choice between these is made something like Replace Inheritance with Delegation can be used later to correct it.
See Also