Don't burn your base class

From CSSEMediaWiki
Revision as of 23:37, 3 August 2008 by Tureiti Keith (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.

Have I burned my base class?

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.

Is it bad to burn my base class?

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

Why did you make me burn it?

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

Personal tools