In article <39D8ECF4.512DA201@vt.edu>,
Kevin Mescher wrote:
> Is there a way to accomplish inheritance in GOOP? I'm trying to
> abstract out some of my hardware control, and I've got a couple
> different types of measurement systems. Any help would be
appreciated.
>
> Thanks,
>
> Kevin Mescher
>
Kevin,
Yes there is good way to simulate inheritance in GOOP. The trick is to
embed, aggregate, the derived classes in the base class and have one
attribute in the base class that determines which embedded class to use.
This is sometimes called inheritance by deligation, since the base class
deligates the calls to its embedded classes.
The attribute is paramterized and set in the Create method. In all
methods in the base class the attribute de
cides which of the derived
classes call.This technique has been used heavily and works find.
Jörgen
Sent via Deja.com http://www.deja.com/
Before you buy.