Overeducated base classes

The opposite of the empty base class is a base class that contains members that aren't meaningful for all of its derived classes. The correct design solution is to push those members down into a derived class--either a concrete class or a less abstract base class. For example, originally the Video Device framework had protocol in the TVideoDevice base class for setting pixel depths, loading color tables, and so on. These operations pertain only to frame buffers, and not all video devices are necessarily frame buffers (such as intelligent graphics boards).

[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker