LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Connection: class or a method in OOP

Hi, simple question for OOP:

 

I have an interface Tester Class, that i can do an dynamic method to connect via all the various methods possible

or I create a connection interface class, with all the possible connection classes as it's children and pass the the Tester Class as an Object ("Uses") relationship.  I am leaning to the latter, since I don't have to pass all the settings to a tester class, but was hoping to get a sound advice.

 

when a tester needs to send commands to a DUT it will need the aforementioned settings as well...

0 Kudos
Message 1 of 3
(3,217 Views)

Another thing you might consider is Composition, which is a "Has A" relationship.  For example, a Tester might "have a" connection object as part of its class data.  

 

I found composition useful when setting up testing for a family of products with largely common functionality but differing communication connections, syntax, and protocols.   Because of this, I could design a device class that "had a" comm object and only needed to use its public API.  

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 3
(3,186 Views)

I meant to say composition, didn't realize right away, that uses relationship is not necessarily composition.

0 Kudos
Message 3 of 3
(3,158 Views)