Move common factors up the hierarchy
From CSSEMediaWiki
(Difference between revisions)
BenMcDonald (Talk | contribs) (New page: :''Factor the commonality of data, behavior, and/or interface as high as possible in the inheritance hierarchy..'' --Riel's Heuristic , Arthur Riel 1996 == See also == * [[Riel's heur...) |
(added some advice) |
||
Line 1: | Line 1: | ||
:''Factor the commonality of data, behavior, and/or interface as high as possible in the inheritance hierarchy..'' --Riel's Heuristic , [[Arthur Riel 1996]] | :''Factor the commonality of data, behavior, and/or interface as high as possible in the inheritance hierarchy..'' --Riel's Heuristic , [[Arthur Riel 1996]] | ||
+ | |||
+ | Any behavior that is shared between all subclasses can logically be promoted to their superclass. If you find yourself moving factors up the hierarchy it may be worth the time to review your design and consider why this inheritance was not spotted at first. | ||
+ | |||
== See also == | == See also == |
Revision as of 22:53, 27 July 2009
- Factor the commonality of data, behavior, and/or interface as high as possible in the inheritance hierarchy.. --Riel's Heuristic , Arthur Riel 1996
Any behavior that is shared between all subclasses can logically be promoted to their superclass. If you find yourself moving factors up the hierarchy it may be worth the time to review your design and consider why this inheritance was not spotted at first.