LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Inheritance in GOOP?

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
0 Kudos
Message 1 of 2
(2,758 Views)
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.
0 Kudos
Message 2 of 2
(2,758 Views)