The top of the class hierarchy should be abstract

From CSSEMediaWiki
Revision as of 23:13, 1 September 2009 by Aidan (Talk | contribs)
Jump to: navigation, search

This idea is very tightly related to Riel's heuristic Avoid concrete base classes. It states that the class at the top of a class hierarchy should be abstract, and if it is not then there may be a design problem. If a subclass B overrides methods in its concrete superclass A, it may indicate that there should be a common abstract superclass to A and B which defines common behaviour; then neither A or B need to redefine any methods. Any example of this is given in Avoid concrete base classes.

See Also

Personal tools