08-03-2017 03:10 PM
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...
08-03-2017 04:25 PM
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
08-04-2017 07:17 AM
I meant to say composition, didn't realize right away, that uses relationship is not necessarily composition.