From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Should I use the AF?

Solved!
Go to solution

I'm an AF newbie... I apologize if this isn't the correct place to post...  I am working on an app and trying to decide if it is worth learning to use the AF or just use an explicit QSM producer/consumer.  My actor structure and inheritance, as best as I can figure, are shown below.

The Pairing Monitor monitors ANT+ RF connections, the USB stick monitor makes sure the user hasn't pulled the USB receiver out of the computer, the ANT+ controller is the root actor, the message processor processes ANT messages (not actor messages - I know, term overloading), the TCP/IP monitor monitors a connection with another app, and the UI/Control panel are self explanatory.

Conceptually, I can see the advantages to using the AF - reusability, modularity, etc.  I'm all for OO and extensibility.  But in trying to learn to use the AF, I've come across four or five different examples which are each set up differently, and using LV's built-in template creator thingy sets up VIs that are reentrant and clones and whatnot and are difficult to follow.  I've seen the presentations, white papers, documentation, etc... I guess my issue is that I'm kind of on information overload at this point.  The AF is such a big departure from the way I've written LV code in the past.  I've gone from sequential LV to learning OOLV to trying to learn to use QSMs and now the AF... at some point, LV stopped looking like LV. 

Any advice for the overwhelmed?

Thanks,

-Jamie

FES1.png

FES2.png

Message 1 of 4
(6,128 Views)
Solution
Accepted by topic author jfalesi

From the technical perspective, this is probably a good small project on which to start learning AF.  It's the framework I would use.  If you anticipate reusing any of these actors on later projects, then definitely consider it.  Also, take a good look at your actors - if any of those actors share characteristics (like, say regular polling of data from some source) then definitely consider AF, as you will realize many opportunities to avoid code replication.

AF will save you having to design a messaging scheme for your system, which is one example of the kind of reuse you can expect to achieve.

However, whether AF would be a good fit here will ultimately depend on a number of nontechnical considerations.

First, what is your timeline?  If you need to bang this out before the end of Q2, then trying to learn a new framework might be a challenge.  This is especially true if you are not comfortable with LVOOP, as you would have to learn that as well.  If you are comfortable with OO and can give this your full attention, though, you could get this done in that time.

Who will take over maintenance of this system when you are done?  If the project is for your own use, do what works.  But if this is for a customer who will expect to maintain their own code, then *their* experience and interest are going to matter at least as much as yours.  If they can't/won't wrap their heads around your code base because it uses OO and AF, you will have a problem.

As this is your first AF project, you can expect to have to do some rework before you are finished.  You'll design a set of actors, and then realize that you've missed an opportunity for inheritance, or that functionality in Actor A needs to be in Actor B. (To be honest, though, I have found that is always true, regardless of project, framework, or level of experience.  I've learned not to fear the rework.)  How tolerant of that necessity is your environment?

I agree that our current project template is pretty horrible.  I've been meaning to make a better one, but other projects have had to take precedence.  Our sample project is good, but hard to follow, because it is very complete.

I put together a hands-on session for NIWeek a few years back.  You might find it helpful.  It's here:  https://decibel.ni.com/content/docs/DOC-23893http://  The application you build is just a bit smaller than the on you are considering.  Feel free to PM me with questions as you work through it.

Are you planning on coming to NIWeek?  I'm actually offering a free 2.5 day AF course the week before (watch for the formal announcement in this forum very soon).  If you can wait that long to take the class, you will be much better positioned to take on AF projects.  If not, PM me, and I may have some other options.

Message 2 of 4
(4,524 Views)

jfalesi wrote:

Any advice for the overwhelmed?

Move forward with your gut instinct.

You present an excellent display of incredibly-well-informed-and-researched technical indecision (this is a sincere compliment). This indicates your most valuable arbiters and champions are your own inklings and gumptions about the nuanced requirements and humans in your business space.

But, if you're rly about to flip a coin between QSM and AF, unequivocally choose AF. Response from @niACS (AF maintainer for 7 yrs now) is spot-on.

Message 3 of 4
(4,524 Views)

Three years late to this party, but I just had to say that this is perhaps the best Q and A I've read on the forums. And while I rarely (if ever) post anything (any more, due to security), I do read. How did I miss this gem? And where's the Kudos? 

Richard






0 Kudos
Message 4 of 4
(3,593 Views)