I suppose this is a theory of OOP question.
Say I have 2 classes, 1 is used to set the voltage on a power supply, and another is used to update a user interface. They are not really related at all in that there is no common parent class and there is essentially no relationship between them.
Now, I write a subVI that is some sort of specialized random number generator. What if I want to use that VI within a method of each of the two classes I created above. Where does this subVI belong?
I can think of the following options, but I'm not sure what the best one is. I would really love to hear your suggestions because it's been bugging me for a while:
1) Create a method within each class that has the random number generator functionality. I don't like this idea because I will be duplicating code.
2) Simply choose to store the VI as part of my project and not include it within the classes. What I don't like about this is that if I decide to reuse my code/class in another project, I will need to copy VIs that are not part of my class with it.
3) Create some sort of "utilities" class that would hold all of these miscellaneous VIs and then use methods from this class. I could pass an object of this utilities class into each class so I would have access to the methods. But this seems to be pretty complicated.
So that's the dilemma. I'm wondering how all of you have chosen to solve this problem. Thanks!