03-21-2015 01:22 PM
Hi all,
My concern is about object based framework.
I'd like to talk about this "sensitive" subject, which divides people around me.
I'm sure there are a plenty of objects aficionados here.
A few years ago, LabVIEW give us the first object based template : the Actor Framework, which is certainly powerfull
...but just UNREADABLE !!!!
When I conduct Core3 training, I'm tempted to show what could be an object based framework in LabVIEW, then I remember how the actor framework looks, then I decide to make my trainies continue to use LabVIEW, and finally I don't show the actor framework.
When will NI provide a SIMPLE object based framework in the TEMPLATES ?
Something like the command patern exposed here by Elijal Kerry :
https://ekerry.wordp...ur-life-easier/
or in a the test executive example of the PTP sequencer :
http://www.ptpartner.../ptp-sequencer/
I still use the "old" QSM (please Daklu, don't bite me), for sure it is not an ideal solution...
I love objects, I used them a lot in my code, but not currently for my high level code.
Any links or suggestions ?
Thanks,
SebastienM
CLA
03-21-2015 01:33 PM
I hacve been poking this idea with a stick for a while myself, and I'm not sure but what the phrase "Simple Object-Based Framework" isn't an oxymoron of the first order. But I agree with you that the Actor Framework stinks on ice. It is overly complex and essentially unreadable. Personally, object-orientation should be a tool in our toolbox that we use when its appropriate and not use when it isn't.
Frankly though, the computer science seems to have gotten over the object oriented fad and is moving on to other things like imperitive programming and functional programming. In fact Carnagie Mellon has made the decision to not even offer classes in object oriented programing to lower-level CS students.
Mike...
PS: About that "stinks on ice" comment, that's just between us right? Nobody else was listening right?
03-21-2015 02:43 PM
03-21-2015 03:32 PM
03-21-2015 04:51 PM
03-22-2015 10:13 PM
@mikeporter wrote:
PS: About that "stinks on ice" comment, that's just between us right? Nobody else was listening right?
Well I read the comment as "sinks on ice" so I suppose you could count that as not really listening (not sure if I have ever heard that saying before but I think I like my version better).
I've looked at the AF example a couple of times and have tried going through the hands on but still have a very hard time making sense of what is actually happening. As someone still trying to learn AF, what are some tips you have when trying to learn this framework and what do you think are some common misunderstandings? I'll also have to make sure to check your blog in the future mike, OOP is something I struggle with quite a bit.
03-22-2015 10:22 PM
03-23-2015 09:14 AM
Hi all,
In my case, I got interested in the AF when i saw some limitation about plugin consideration and maintanability using standard QMH based architecture.
Using a lot QMH based architecture and wondering about some of its limitation, the understanding was a bit easier for me though I am far from being an AF expert. Though this is really interesting, I don't think knowing the low-level of the framework is mandatory to use it in a good way.
I wouldn't say such things as "never use AF" or "Always use AF" but at least try it and see if it can fit the requirements for some of your projects. This is actually the same kind of advice I give to beginners in LVOOP.
Regards,
Romain DUVAL || RF & Semiconductor Staff System Engineer || CLA || CTA
National Instruments France
03-23-2015 12:41 PM
Hi,
Let me add some informations :
I don't know how is the "story" elsewhere, but here is the "story" in France :
Once uppon a time, in a country with a lot of frogs and wine, little companies, called NI partners were born.
From this time to "now", these companies used a simple but "powerfull" high level template.
This template was a "secret", each company tended to think the other one didn't know about it.
It's name was.... "la machine d'état" (in french), akka "the state machine".
But this name is wrong, the real name is the "Queue Driven Message Handler" or QDMH or QMH or QSM.
Trust me, a lot (the most) of NI partners in France still use it.
And trust me, a lot (the most) of NI partners in France use it regardless of the problem to use.
"Today", object based structures tend to be THE good stuff to use, and the QDMH tends to dicrease in popularity. There are pro and cons.
It has been discussed a lot, especially by Daklu (https://lavag.org/topic/13064-object-based-state-machine-pattern/).
I understand all you arguments and I confess : I use objects in my LV developments but I'm not a specialist (but I'd like to ^^).
I accept this evolution and I want to use more and more object in the future.
In the Core3, NI wrote about objects, so I'm tempted to show some stuff about objects.
In the NI training, including the Core3, NI use the magical rules : "readable, maintenable and scalable".
I admit QDMH is not as powerfull as it seems, so it is not "really" scalable.
In the other hand, I think the AF doesn't suit the "readable" rule... it is "overly complex and essentially unreadable" like Mike Porter said.
Finally, I just expected a template based on objects, but with 2 big characteristics :
- readable (simple) like the QMH
- usable """""""everytime"""""" like the QMH (please, don't bite me)
The command pattern seems to fit with that :
Regards,
SebastienM
03-23-2015 02:05 PM
It is not the topic of the forum but contrary to you I think this is important to make the distinction between a LabVIEW state machine and a LabVIEW Queue Driven State Machine / QMH/ QDMH. As the first one does not imply using a queue to share Next-State(s)-to-execute info between cycle. And most important the QMH/QDMH/QDSM allows for stacking next-state-to-execute info from external process (I mean other while loop or async process) which is not possible with a "local" shift register.
So finally QDMH/QMH/QSM is a design pattern based on another design pattern called a state-machine that allow more flexibility and inter-process communication leveraging the use of queues.
Regards,
Romain DUVAL || RF & Semiconductor Staff System Engineer || CLA || CTA
National Instruments France