Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Actor Naming Conventions?

I'm curious about the naming conventions advanced users have adopted for their actors. Some of the beginner AF tutorials I've seen recommend putting the actor and its messages into a library, like this.

 

  • MyHardware.lvlib
    • MyHardware Actor.lvclass
      • Foo.vi
      • Bar.vi
    • MyHardware Actor Messages
      • Foo Msg.lvclass
      • Bar Msg.lvclass

It looks ok in a hierarchy view, but the namespace gets a bit ridiculous (MyHardware.lvlib:MyHardware Actor.lvclass:Foo.vi), especially when the actor has a longer name.

 

Is there a disadvantage to leveraging the library namespace, like this?

  • MyHardware.lvlib
    • Actor.lvclass
      • Foo.vi
      • Bar.vi
    • Actor Messages
      • Foo Msg.lvclass
      • Bar Msg.lvclass

It still looks ok in the hierarchy view, and the namespace makes more sense (MyHardware.lvlib:Actor.lvclass:Foo.vi). It means all actors would just be called "Actor.lvclass", but if they're encapsulated in a library, it should be ok, right?

0 Kudos
Message 1 of 4
(2,551 Views)

Classes and method overrides can certainly all have the same names and would be unique through the library namespace. I rather prefer to have a descriptive name though. The namespace is not the only place you'll see this name, so it helps to have a descriptive name when only the vi name is apparent. I've been truncating the vi names or using abbreviations as much as I can as long as they make sense. I have established a standard set of abbreviations that are mostly obvious. I use these for actor names and methods / messages. I think this is a good tactic anyway for readable vi trees and standardization across projects. 

 

I've actually run into path length problems when building exe's for RT from these actor trees. It's especially tricky with actor messages because of the folder tree created for them. 

0 Kudos
Message 2 of 4
(2,548 Views)

I would say there is nothing wrong with what you are proposing. The library should namespace everything correctly to avoid collisions.

 

Since the tooling enforces the traditional standard, I would imagine most people just follow that. That's what I do. I can see the problem with RT, but I don't do a lot of RT and when I do typically don't use AF.

 

Sam Taggart
CLA, CPI, CTD, LabVIEW Champion
DQMH Trusted Advisor
Read about my thoughts on Software Development at sasworkshops.com/blog
GCentral
0 Kudos
Message 3 of 4
(2,528 Views)

Alright, well I think I'll try leveraging the namespace. It also has the benefit of making things a tad more portable (for instance renaming an actor just means renaming the lvlib & folder, but the Actor & Messages stay untouched).

 

Regarding the tooling, I think everything will still work. The message-makers create "[ActorName] Messages", which is fine since [ActorName] is just "Actor". Is there other tooling that could be an issue?

 

We're not using RT right now, so the length isn't an issue, thankfully. Some of our developers name their folders in a way that paths are pushing 120+ chars.

0 Kudos
Message 4 of 4
(2,508 Views)