LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reuse Class update methods in project

Hello,

 

I have an OO question.  I want to have a common reuse class.  I have this reuse class in multiple projects.  Lets say I add a method to the Reuse class.  How do I get the new method into the projects that use the reuse class?  Do I have to manually add the method to my class in every project that uses the reuse class?  Is there way of automatically loading classes from file that may have methods added to them?

 

Thanks

Dan Shangraw, P.E.


   

0 Kudos
Message 1 of 5
(2,863 Views)

If you keep this class in one shared location, and just map your project to it, then of course, new method will be added to other projects. Because you will refer from your projects to original, shared location with the class - so you can access its actual methods, etc. without issues.

But if you copy copies of this class "physically", and put them to folder with your projects, then of course, there's no chance, that new added methods will be added to your projects.

 

As soon as you create copy of the class, plugin, etc. and physically move it somewhere - it'll not be updated automatically when you'll modify original "copy" of class, plugin, etc.

 

Sincerely, kosist90

 

logos_middle.jpg

Check out new features and changes in LabVIEW 2017!

0 Kudos
Message 2 of 5
(2,838 Views)

Hello,

 

Having a the reuse class in one shared location is my use case.  So if I add a method to the reuse class the project that is referencing the reuse class will have the new method?  Do I have to refresh or reload the class?

 

Thanks

Dan Shangraw, P.E.


   

0 Kudos
Message 3 of 5
(2,834 Views)

LabVIEW automatically loads all the methods (VIs) of the class when loading the class itself. You only need to add your new method once and it will be loaded in all the projects.

0 Kudos
Message 4 of 5
(2,815 Views)

If you want to use this on multiple computers (for example with source control) and you don't store the reuse class inside each source-controlled directory, you should be careful with paths - it's pretty likely that the paths won't be the same on all of your computers (unless they're clones).

 

VIPM and distributing packages can help you with this, but then you have to rebuild the package each time you change it, which can be annoying (but then they're still automatically loaded when needed).


GCentral
0 Kudos
Message 5 of 5
(2,802 Views)