04-07-2011 05:48 AM
When using LVOOP classes and G# classes you are actually using two different types of architectures, by value or by reference. The G# Framework supports the use of both types and there are no general principle where a conversion could be made automatically. In one archutecture today you may find solutions that you can solve it using both types, for instance the object of an LVOOP class is useful as a datacarriers that can be copied and distributed in your whole architecture.
There are many discussions, particullary in the LAVA forum of which architecture is the best, by value or by reference. I belive the answer to that is both, depending on the problem to solve.
//Patrik
04-07-2011 11:24 AM
Hi,
This is something we actually discussed many times, since we also believe that this would be a nice feature, but when thinking about it a bit deeper there are three major challenges.
1) Just as PatrikC mensions, the design you make (or are force to make) with native by-value LV classes are usually different from the one you make with reference based at least not always replacable.
2) There are no natural contructors or destructors in LV native classes that are required in G# (or any reference based provider) and would cause many broken VIs if converted. These must be added, bit hard to find an automatic way of inserting these.
3) The scripting code in the G# IDE that would convert especially the reading and writing the attributes in a method, looks very different when using G# compared to native LVclasses. This would be quite a LabVIEW scripting task, if not impossible, to get a good way of fixing nicely.
These issues all together are the major reason that there isn't any support for this convertion or is very unlikely to be. I really wish that there could be a simple way to solve it, but I don't think there is unfortunatly.
However, there is nothing that stops you from mixing both G# and LV native classes in a project. Sometimes native classes could be good to use, like using them as "smart" data carrying clusters e.g. result containers. You could actually compare LVclasses to structs in C#. A struct is also passed by value and could also have methods, but can't be subclassed though.
/Mattias
04-07-2011 12:35 PM
Hi;
Thanks PatrickC and MattiasEricsson for detail explanation. I really appreaciate it. Now I know why there is no conversion features from G# to native LVOOP class and vice versa. Thanks again.
04-10-2011 01:37 PM
I have a small feature request...
Generating UML from a class hierarchy works beautifully, but when I go the other way to create G from a UML diagram, I have a dialog prompt that requires that I specifiy the destination for every single object to be created. This is a rather time consuming process, so it would be great if I could just specify a root folder and the tool would automatically create the hierarchy of folders and files..
I'm still learning the tools, so their may already be an easier way to do this... it was just something I noticed when playing around with it.
Definitely an awesome tool all around!
Eli
04-12-2011 11:32 PM
Hello Elijah!
That is a really good idea. This will be implemented in the comming release!
Thanks for contributing!
Cheers!
Andreas
04-13-2011 10:11 AM
Hi Fox -
If you take Eli's advice directly, I'd like to be able to set some options that dictate the behavior of the code generation tool. I expect people will have different preferences regarding how to store classes on disk. (I like a flat listing of folders inside the project folder. Hierarchy is not represented on disk, only in the LV Project or Library.)
04-13-2011 10:21 AM
Hi David!
Different disk and project hiearchies. That is also a really good idea.
I guess, "flat" or by "base class" hierarchy could be implemented.
Lets see what we can conjur up before the next release!
Many thanks for your contributions! Keep on posting!
Cheers!
Andreas
04-13-2011 10:23 AM
Looks like you have a regular "G# Idea Exchange"
04-14-2011 02:10 AM
Hello,
I have a small feature request about code generated from uml file.
Documentation of UMLClass is fill in descrption property of the created Classes.
Documentation of UMLOperation is fill in description property of the created VIs.
Is it possible to have MyClass.lvclass:ObjectAttributes.ctl controls documented by information contain in UMLAttribute description ?
It will be helpful to document code and it will avoid to do the work twice (in StraUML and LabVIEW)
Regards
04-19-2011 12:53 AM
Hi Olivier!
I have been quite busy and have not had the time to answer. Sorry about this.
Your idea is really good. We actually have this functionality implemented but disabled for the moment. The reason for this was that during the beta trails our testers reported that documentation set in StarUML or in LabVIEW seemed to vanish at some point. When we explored the reson for this we noticed that this was due to different work processes using the G# StarUML Plug-in.
While some users used the tool just for reverse engineering and hardly ever generated code others did just the opposit. However, there were a handful users who did some of their documentation in LV and some in StarUML. The problem occurred when you had updated documentation in both and then did a reverse or code generation. The documentation was simple overwritten.
I guess the right way to approach this is to implement a option to update documentation of both reverse engineering and code generation.
Consider this feature implemented in next release.
Thanks for contributing!
Andreas