04-24-2012 02:47 PM
Hi,
i have a slew of 25 or so classes that i have kept in one .lvlib. Most of the classes are drivers i've written for various measurement instruments. As of today I am tired of writing simple one vi programs that needs a class from that library and the whole library gets included in the project file along with the compiled executable.
I know this setup might not be the best setup but it is what worked for me. My top level ancestor class for most of the classes was called 'test hardware.lvclass' it had three variables in it, VISA, IP Address, and Port. As one can imagine, i only needed to use VISA or IP and port. I want to go away from this huge hierarchy ending with this single ancestor class. The reason i have had them all in the same library is because i was under the impression that LabVIEW classes had to be in the same library to inherit from each other. I have found from testing now, that is not the case.
So for those of you who i have worked with classes and large hierarchies spanning multiple libraries what issues should i watch out for if i were to start separating these classes into different libraries and inheriting from classes in other libraries? I'm not sure this is best way to go but it is something i am investigating. Also, i could get rid of test hardware and just give each piece its connection information but i'm not sure thats the way i want to go either. Does anyone have any thoughts on this?
04-24-2012 03:03 PM
I really like the new library option becuase it cleans-up my hiearchy and let me colapse the nonsense classes to let me focus on the task before me.
The only "issue" was minor and other may not even care.
The "Issue" was recursive lbrary calls. Example
Library A calls into Library B tht in turn calls into Library C that uses a function from Library A. You end up with recursive calls in the hiearachy screen (dotted line going back up the screen) and I did not like how it looked.
As long as your private/protected/public scope is sett properly, I know of no issues.
Ben
04-24-2012 03:18 PM
Ben,
thanks for your input, im going to quickly separate them out and see how that might work. I'm really trying to refactor my code the right way, we are switching from clearcase (UGH) to GIT (YAY) for source control and I want to get it into GIT correctly the first time.
04-25-2012 07:24 AM
I would like to hear about any issue you may run into while doing the change over. Scarse littel has been posted on the topic and I would appreciate learning about the challenges, if any.
Thank you!
Ben