|
|||||||||||||
(Resubmitted to include pictures)
Similar to the discussions on command and data cluster primitives, it seems many programmers would like the ability to have a primitive to move a message and some additional data easily. The current methods involve casting specific data types to generic types (i.e. Variants) which are then passed to sub-processes. Once in the sub-process, the process reverses and the data is cast back to the specific type. Many times this casting to and from generic data types not only takes time and resources but also requires managing many type def'ed controls for each specific data type used.
Here is a traditional method for passing data between processes:
Alternately, if the message (such as an enum) included the specific data type definition then no casting is required. This idea involves embedding inherancy of private class data into a defined LabVIEW primitive where each command/item is its own class of private data. It's like having your cake and eating it too! Or, it's like having your message and the data too! (cheesy, i know). Below is an idea for the configuration of the "Defined Enum":
Like a tab control, each tab is an Enum Item and the controls within the tab are specific controls associated with the item. The Defined Enum loads a drop-down selection list of the private data associated with the current item.
In the block diagram, like property nodes, the accessors would be used to get or set the values of the enum items.
The sales pitch: When developing large applications where there are multiple services running in parallel it is often difficult to develop completely modular processes because the casting to and from specific data types require a control dependancy between the caller and the callee. Eliminating generic data casting would help develop a more robust hierarchy. I applogize if this idea is a repeat. Let me know what you think.
-Ryan
What you ask for is called a LabVIEW class. Yes, really. With all the polymorphism that you're looking for.
And your solution to the communication problem of this data? Please check this out: https://decibel.ni.com/content/docs/DOC-17193
I will say that I've been looking for images that make classes easier to view on the diagram, and I may borrow some of your approaches here for that purpose.
Just wanted to add a quick comment to this thread: this idea is an important archive piece for the LabVIEW forums, because it demonstrates a common design challenge with great illustrations. People searching for a solution - yet lacking vocabulary such as "run-time polymorphism" ("dynamic dispatch") and "strictly typing" vs. "stringly typing" - might stumble upon this thread and discover LabVIEW Classes and LVOOP principles! So, +1 to rcpacini for the detailed write-up!
"User Events" are another method in LabVIEW that also allows the equivalient of strictly-types messages, in addition to LVOOP and the "Command Pattern".
It would be useful to attach a LVOOP implementation of the drawings to complete the loop. You've then taken a common challenge with great visual documentation and turned it into classes that people are more likely to understand and appreciate.
Wart: Excellent point. I do not have it as images, but I do have that "finish the loop" as video:
http://zone.ni.com/wv/app/doc/p/id/wv-3101
This web video shows the progression of how we go from a messaging scheme using an enum and variant pair to a class implementation and then into the Actor Framework for communications.
You must be a registered user to add a comment here. If you've already registered, please log in. If you haven't registered yet, please register and log in.
Post New Idea to submit a product idea to the LabVIEW Idea Exchange. Be sure to submit a separate post for each idea.
My Profile | Privacy |
Legal |
Contact NI
© 2011 National Instruments Corporation. All rights reserved. | E-Mail this Page
|
||

E-Mail this Page