Abstract classes should be base classes

From CSSEMediaWiki
Revision as of 10:17, 6 October 2008 by Tureiti Keith (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Riel's Heuristic #5.6: All abstract classes must be base classes.

Description

From [1]:

If a class cannot build objects of itself, then that class must be inherited by some derived class that does know how to build objects. If this is not the case, then the functionality of the base class can never be accessed by any object in the system, and therefore the class is irrelevant in the given domain.

The corollary of which is Riel's heuristic #5.7: All base classes should be abstract classes.

See Also

References

  1. ^ Riel, A. J. 1996 Object-Oriented Design Heuristics. 1st. Addison-Wesley Longman Publishing Co., Inc.
Personal tools