Factor implementation differences into subcomponents

From CSSEMediaWiki
Revision as of 06:34, 12 August 2008 by Kris Nicholson (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This is Rule 10 in Johnson and Foote 1988.

If different subclasses implement a method in one of a few ways, then the method may not be directly related to the superclass and the implementation should be separated by creating a class hierarchy and composing it within the superclass.

This means that multiple subclasses can contain the same implementation without repeated code.


See Also

Personal tools