Don't burn your base class

From CSSEMediaWiki
Revision as of 07:50, 5 October 2008 by Tureiti Keith (Talk | contribs)
Jump to: navigation, search

This is a comment on the use of inheritance, and is especially applicable to object-oriented programming languages that employ a single inheritance model.

A designer has “burned” their base class when they have, perhaps unnecessarily, used inheritance to access the attributes and / or behaviours of another class. In a single inheritance model, they have consumed or “burned’ their one chance to inherit.

If a designer has “burned” their base class, it may be inferred that the designer has misused the inheritance model. This can be the case where the inheritance relationship does not represent a specialisation of the base class, or does not take advantage of polymorphism.

In some cases, a designer can force a client to “burn” their base class by providing access to functionality or behaviours via inheritance only.

Refactor With

See Also

Personal tools