Avoid concrete base classes
From CSSEMediaWiki
(Difference between revisions)
Line 2: | Line 2: | ||
What does Riel mean? Does he give an example? Have we got any examples of our own? Do we believe Riel? | What does Riel mean? Does he give an example? Have we got any examples of our own? Do we believe Riel? | ||
+ | |||
+ | Riel states that all base classes of an inheritance hierarchy should be abstract. Note that this does not mean that single classes with no inheritance hierarchy should be made abstract, as this would mean a concrete subclass would have to be created that adds no meaningful functionality - this violates Heuristic 3.7; [[Eliminate irrelevant classes]]. | ||
+ | |||
+ | More to come... | ||
== See also == | == See also == | ||
* [[Riel's heuristics]] | * [[Riel's heuristics]] | ||
+ | * [[Eliminate irrelevant classes]] |
Revision as of 04:18, 2 September 2008
Riel's heuristic #5.7: All base classes should be abstract classes.
What does Riel mean? Does he give an example? Have we got any examples of our own? Do we believe Riel?
Riel states that all base classes of an inheritance hierarchy should be abstract. Note that this does not mean that single classes with no inheritance hierarchy should be made abstract, as this would mean a concrete subclass would have to be created that adds no meaningful functionality - this violates Heuristic 3.7; Eliminate irrelevant classes.
More to come...