12-06-2010 06:12 AM
Hello,
i have done one project in lvoop : a T° calibration software
now i have another one with humidity but software are used separatly
I see i could reuse most of the first one but i don't know how to manage it :
1) i can use the same project but softwares are distinct and T° classes and devices linked to will be loaded for nothing
or maybe i could load them dynamically but for the moment it isn't the case
2) or creating a differente project so how can i reuse classes used in the first one
and how to do when changing class parametes or functions. how to have shared classes
i think the first solution could be the best way but as i am new to sofware management
i would like to collect points of view of experimented developers
What do you think about ?
Best regards
Tinnitus
12-06-2010 06:30 AM
...
Also I have to consider that demand can evolve, ie , calibrating barometer, flowmeter, multimeter ...
is there a limit creating classes, how it could impact on performance in terme of time response and program size ?
for moment i have ~50 classes parents/childs merged.
best regards
Tinnitus
12-07-2010 03:31 AM
Hi tinnitus,
It is quite hard to answer your question....
In fact usually in Object Oriented you should think about the maintenance and upgradability of your application.
What I can suggest you is to create a general class (the parent class) then different children depending what type of measurement or sensor you use. Then you can implement your code using Dynamic Dispatch (the VI Server for LVOOP ;-). So your code will automatically invoke the proper method depending the class he's got as input. Using this approach you can have a very generic top level VI calling dynamically the class children.
A dynamic dispatching subVI has some small overhead when LabVIEW looks up which subVI to invoke. The overhead is constant. It does not increase as you add more classes or as you add more dynamic VIs to a class. There can be a performance hit if the subVI call has to make extra copies of the parameters to match the functionality of the actual subVI LabVIEW invokes. You can avoid this by wiring the input front panel terminals to output front panel terminals even on dynamic VIs that you never expect to call (for example, parent VIs that exist only to define the connector pane for children to override). You can also use Data By Reference in you class to optimize memory management.
Feel free if you have any further question.