Beware inheritance over composition
From CSSEMediaWiki
(Difference between revisions)
Line 6: | Line 6: | ||
== See also == | == See also == | ||
* [[Riel's heuristics]] | * [[Riel's heuristics]] | ||
+ | * [[Favor composition over inheritance]] | ||
* [[Multiple Inheritance]] | * [[Multiple Inheritance]] | ||
[[Category:Riel's heuristics]] | [[Category:Riel's heuristics]] |
Revision as of 22:14, 28 July 2009
Whenever there is inheritance in an object-oriented design ask yourself two questions: 1) Am I a special type of the thing I'm inheriting from? and 2) Is the thing I'm inheriting from part of me? -- Riel's Heuristic 6.2, Arthur Riel 1996