Extract Superclass
From CSSEMediaWiki
(Difference between revisions)
m (Reverted edits by Ebybymic (Talk); changed back to last version by Brett Ward) |
|||
Line 3: | Line 3: | ||
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. | 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 == | |
{{Refactoring}} | {{Refactoring}} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 03:23, 25 November 2010
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