03-28-2013 05:35 PM
JackDunaway wrote:
At worst, it gets devs on the hook to some fantastic concepts, and once they start down the path of implementing AF, can start to figure out on their own through trial and error what's important for their app domain.
Gotta agree with David and Brian. In the abstract that might be a great way to learn how to do AOP. In the business world that's often fatal.
03-28-2013 05:41 PM
Daklu wrote:
AristosQueue wrote:
By "NI" I assume you mean me, Allen, Eli, Brian and Nancy?
Nope, I actually meant NI as a company, because there appears to be--to us external viewers--a widespread effort to promote the AF. If there really isn't a widespread effort to promote it then you, Allen, and Eli have done a fabulous job of getting the word out.
Wow, I am 1/3 of a widespread effort. That's awesome!
03-28-2013 05:58 PM
Brian_Powell wrote:
Don't get me wrong--if you need the AF, then we encourage you to use the AF. It's just that many customers can't correctly answer the "if you need the AF" part of that.
The Actor Framework whitepaper sends the following message:
"National Instruments created The Actor Framework to fill a hole in the standard architectures used by LabVIEW programmers. The Actor Framework builds on the well-known queue-driven state machine1 (QDSM) model, which is shown in the following figure."
It appears to the reader if you are using a QDSM and understand LVOOP, then you should be using Actors...
By applying some common object-oriented techniques and design patterns to the original queue-driven state machine, National Instruments created a framework that provides:
- All of the benefits of QDSM design
- Significantly increased flexibility
- More reuse potential
- Reduced coupling between modules
1. I think this topic should be NI and the community need to clarify the appropriate use case and expectations for the Actor Framework. I attempted to bring up this discussion in the Actor Overload! topic. The conclusion seemed to be use an Actor if the following criteria are met:
It was also identified in this topic that the AF does not scale well within the LabVIEW IDE.
2. I think it would be very useful to discuss a real-world LVOOP DAQ/instrument driver example. Why not use AF for Continuous Measurement and Logging with a hardware abstraction layer built in?
Looking forward to your responses. There seems to be a lot of passion on this topic...
03-28-2013 06:10 PM
Brian_Powell wrote:
David_Staab wrote:
JackDunaway wrote:
I have no problem with NI championing Actor Framework as a monolith without strong focus on discrete AOD principles. At worst, it gets devs on the hook to...figure out on their own through trial and error what's important for their app domain...everyone wins. yeah?
Somewhere in the world, a Project Manager just got a cold chill down his spine and doesn't know why.
I know I did, but I know why. At worst, a novice to intermediate programmer fails and blames LabVIEW for his failure, because that's easier than accepting that he doesn't have the necessary skill (e.g., training and experience) to be successful.
I agree that presenting AF to a novice/intermediate programmer has some fallout, but I'm coming at this from a different perspective. Trying to coax more influencers out of the woodworks to publicly discuss high-level software engineering topics. Pushing the technical limits of the existing IDE and language's scaling capabilities. AF in an of itself (not just AOD) has done important things for our community and LabVIEW as a product, and the community is mobilizing with its own voice and methods for AOD. Guess I'm just saying that AOD principles don't have to necessarily originate as NI curriculum; and I'm glad that AF has been a vehicle and common thread for making some cool stuff happen. Is this too optimistic? 🙂
03-28-2013 08:59 PM
LVB wrote:
2. I think it would be very useful to discuss a real-world LVOOP DAQ/instrument driver example. Why not use AF for Continuous Measurement and Logging with a hardware abstraction layer built in?
Here's one attempt, hot off the presses...
03-29-2013 11:13 AM
LVB wrote:
1. I think this topic should be NI and the community need to clarify the appropriate use case and expectations for the Actor Framework. I attempted to bring up this discussion in the Actor Overload! topic. The conclusion seemed to be use an Actor if the following criteria are met:
- You have the time to develop reusable code
- You need a parallel process/loop in your application that would use a QDSM
It was also identified in this topic that the AF does not scale well within the LabVIEW IDE.
When you get down to it the AF is a good solution when:
Obviously #2 is the big unknown and depends on a lot of different factors.
One thing it depends on is the development process a person uses. My dev process is very organic--the app grows into existence based on feedback from the customer rather than being constructed from a predefined blueprint. I do a lot of refactoring and reorganizing during development. The AF is on the "stiff" side; making changes takes more effort than I like and it ends up getting in the way of my dev process. The AF leans towards a BDUF dev process.
Another factor in estimating the time to implement an AF project is the level of decoupling required. In it's simplest form the AF messaging system creates a tight web of statically coupled classes. As people have discovered, unmanaged static dependencies are hell on IDE responsiveness. Breaking static dependencies requires building additional code in the form of a callback system that uses runtime registration. This adds dev time to the project. You either have to build the callback system yourself or spend time learning how to use the Advanced Message Maker tool, and more code means more editing when something needs to be changed.
How can the AF save you dev time? If your dev process requires a high level of provably correct code (i.e. you have a lot of junior developers who are prone to making mistakes or are writing Deep Space Explorer code for NASA) then the time saved not testing and verifying implementations could eclipse the additional time spent making changes and implementing a callback system.
03-29-2013 02:00 PM
JackDunaway wrote:
Guess I'm just saying that AOD principles don't have to necessarily originate as NI curriculum;
You are correct that they don't necessarily have to originate from NI. However, over the past several years I have learned it is extremely difficult to gain significant traction in the community with any messages that do not align with NI's marketing. I can't tell you how many times my explanations of the problems with the QSM were met with, "well that's what NI recommends so I'm going to use it." For the vast majority of Labview users, NI is the authority on how to do things. Unless someone from NI agrees with you and takes it upon themself to promote the message, it is largely ignored by the community.
In the past I've expressed frustration over the lack of guidelines or rules for QSM designs**, and how their absence makes it far too easy to introduce subtle bugs. AOD is what QSMs should have been. AOD provides the guidelines for successfully implementing concurrency that are missing from QSM development practices. The only important difference between an actor implementation and a QSM implementation is that the actor follows the guidelines and a QSM does not. AOP completely replaces QSM programming. AOP can do everything a QSM can do, except it can do it more safely, more clearly, and more flexibly. Or to look at it another way, a QSM is nothing more than a malformed actor burdened with truckloads of code debt.
Once the fundamental component of an actor is understood to be the message handling loop--not a vi, or a class, or a message transport--it becomes much easier to talk about and evaluate the tradeoffs associated with specific implementation options. I've tried to communicate that to people and show that implementing actors is not that different than implementing a QSM. You don't need a framework to do AOP. In fact it is very easy to implement actors without a framework. If the features provided by the AF align with your project requirements, I wholeheartedly encourage you to use it. However, it is clear the AF implementation makes it unsuitable for some subset of all projects. (The size of the subset is open for debate.) On the other hand, AOD principles are suitable for a much larger subset of projects, and includes all projects the AF is suitable for.
As long as NI promotes the AF as the way to do AOP instead of just a way to do AOP, people are going to continue to use it when other implementations are a better solution for their problem. That doesn't help the developer trying to write the app, the community trying to adapt to new programming principles, or NI trying to meet their customer's needs. But until someone from NI agrees and puts some authority behind the message, I'll continue to be...
Spittin' Inthewind
(**I'm referring to commonly seen public sequence QSMs, not private sequence QSMs like the JKI QSM.)
03-29-2013 02:33 PM
This thread has been about how much more backstory the AF documentation needs to have. I think documentation of that sort is best left on the forums and NOT in the LabVIEW product or hands-on session. I have tried with the AF shipping documentation to follow a route very similar to the route taken with the OO programming, only this time I did not have the benefit of April Griffin nee Brinkmeyer, technical writer extrordinare. She created literally award winning documentation for LVOOP in no small part by paring down a lot of the OO philosophy that was in my original draft, making it accessible to users on their own and signposting that, if they were interested, there was more to this OO world that they might find online or in books. I tried to follow the same pattern with the AF documentation, but some part of me worries that I didn't pare it down enough.
The AF was designed to be powerful enough for the high level users on this list. I wanted it for my own software development. Indeed, I felt LabVIEW needed something to bring order to the chaos at the high level architecture levels. So it is a robust tool, capable of expressing great subtlety, and it makes its pro/con tradeoffs, the same as any other tool. It is a tool designed for the tip of the user pyramid.
But what really spurred it's development were e-mails to me from users at the middle of the user pyramid. I try to discourage users from e-mailing me directly because I don't have time to handle every request and often the online community can give as good or better an answer than I can alone. But some do e-mail me anyway when they get desperate, on the off chance they catch me on a good day. The following is the boiled down text of multiple e-mails that I got between 2008 and 2010 from users:
"Hi, I'm a LabVIEW user. I've been given an assignment to build this multi-part industrial control system. It has several parts working in parallel that need to communicate with each other. I've got the whole thing working, but it won't shut down. I can't make it stop except by quitting LabVIEW. Can you look at my code and see what I'm doing wrong? I've been programming LabVIEW for a couple years now, maybe thinking about trying for my CLD, and I'm the only LV user in my company, so I don't have anyone else to ask."
This is the person I had in mind when I wrote the main documentation for AF.
I've now worked with a lot of people to explain what was wrong with their ad hoc messaging system. I've tutored a lot of people in the use of the AF. I've spent time doing both one-on-one sessions and large lectures. What I realized over time is that these folks were being asked to do projects that exceeded their own experience with software development, and they were flailing against something like "blank diagram syndrome", only this was "blank project syndrome". They had no idea how to build the architecture they needed for their project.
If I am going to help those users, I am *not* going to teach them 15 different ways to accomplish the same task and giving them guidelines for picking the right one. I am going to say, "This is *a* right answer. Do this to accomplish your task." Are there cons that they will encounter with that path? Sure. But for the most part they will never know they encountered those cons.
For example: "You need to decouple static binding between modules in order to get editor performance." No, not really. The Feedback Evaporative Cooler shipping example, including the VIs from vi.lib, is about 260 files (libraries and VIs). Performance of the editor there is fine. The only non-static binding there is the one that needs to be there for the project requirements -- the ability to swap UIs on the fly while leaving the cooler running. And even with that, there's a hefty amount of code reuse possible from that project. Will you have a few things slow down at 500 files? Sure. But is it significant? Not when compared to not getting the job done at all.
In other words, the AF was designed to solve a tip-of-the-pyramid problem but documented for someone with middle-of-pyramid experience. The users targeted by my documentation are the majority of LabVIEW users whose entire VI hierarchies load into memory when they open their top-level VI who find themselves having to make the leap from a simple producer-consumer to a multi-part system, on their own. I'm trying to offer them the AF as a way to handle that sudden jump in complexity in a way that gets them working without making the documentation a six week course in architecture.
The advanced conceptual backstory of the AF is exactly where it needs to be -- in the forums, in web casts, and in the heads of the other CLAs who lurk about.
I hope Daklu and Staab keep this in mind when they create their NIWeek presentation: Their presentation will NOT be an introductory presentation for new AF users but will instead be an advanced presentation for architects. Presenting the other options and the philosophy of design is, in my experience, at minimum unhelpful and often actually harmful to a new user of the AF. The information is good, and I encourage them to present their findings, but not to pitch it as if they're making AF adoption easier for a user. I would make a similar recommendation to any of the rest of you who teach the AF in a lecture setting or in documentation fired into cyberspace. Only a teacher who is going to be around the student through their whole learning/adoption process has the luxury of presenting theory mixed with practice. Everyone else, stick to the basics, and let the students find their way to the forums when they reach the point where they need more input.
03-29-2013 02:40 PM
Stephen, Allen and I talked a lot more about back story and other Actor Framework topics on the latest VI Shots podcast episode. I encourage all AF enthousiasts to give it a listen.
03-29-2013 02:46 PM
Daklu wrote:
As long as NI promotes the AF as the way to do AOP instead of just a way to do AOP
Just so you know, I posted my last post where I said "This is *a* right answer. Do this to accomplish your task." before I saw Daklu's post. And it is *a* right answer. I want to see it become a systemically used right answer because that will open up a lot more utility for it (imagine how much work would be saved if every piece of hardware came with an already rolled actor framework API ready for communicating with it).
One of the reasons that I've developed the AF in the full view of the community was to make it clear that there are debates about the ways to do things, that there are trade-offs. What settled out of that process is a good solution, and for some people and some situations, good is better than great because it is known. And for that reason, it will be called *the* right way by many people because it is the branch that they were able to grab onto while drowning. That's not a bad thing, nor is it necessarily something to combat. It's one of the stages of development. When they're ready for a broader view, they'll ask.