Actor Framework Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate actors and plug in approach

Solved!
Go to solution

Hello everyone,

 

I'm new in AF and I would like to start with it with a re-build of a previous project which is a game.

I think that I defined all the main part to be the more generic and scalable and defined a template : "Game Template".

 

And I would like to start each new game from this template. In a classic OOQDMH, I just need to right click and "save as" my library. But there that doesn't seem to be the right way to do this because of the message maker scripting tool which work with the file name folder.

 

What is the right way to duplicate Actors which are defined as templates ?

 

The second point is about making the "Game Template" a plug in to be launched by "Game Selector" (I would like to make some games and the application to storing them).

I learned and tried successfully the simple approach based on cast my plug in with an abstract plug in class. 

But it was simple actors wich don't call nested actors. Here the "Game Template" call many actors...

 

Again, what is the right way to call a plug in actor which need to call some nested actors itself ?

 

To help in the understanding of my application needs, I attached a documentation which explain the way that my application could work at the end !

 

Thank you for your help !

 

Loïc

0 Kudos
Message 1 of 5
(5,447 Views)

I'm trying to answer at your first question.

You can see this plugin to duplicate an actor template. It works well and you can add your own template. I didn't find a better way to duplicate an actor template.

https://forums.ni.com/t5/Actor-Framework-Documents/Events-for-UI-Actor-Indicators/ta-p/3869260?profi...

 

For your second question, I have never done plugin in actor.

😉

Good luck for your research.

 

Marc R.

0 Kudos
Message 2 of 5
(5,378 Views)
Solution
Accepted by topic author Loïc.W

If you're trying to clone the actual code of a template actor to create a new actor, you may be interested in these two VIs:

  • vi.lib\Utility\EditLVLibs\Rename And Move Entire Library By Path.vi
  • vi.lib\Utility\EditLVLibs\Rename And Move Entire Library By Name.vi

(The second is a wrapper around the first.)

 

>Again, what is the right way to call a plug in actor which need to call some nested actors itself ?

You launch any actor the same way -- by calling either Launch Actor or Launch Nested Actor -- regardless of the actors inside of itself. Each (properly designed!) actor is completely self-sufficient... the caller doesn't know anything about the internals of the actor. A nested actor may just be itself or it may have hundreds of deeper nested actors. The caller doesn't (shouldn't) know (and doesn't (shouldn't) care).

Message 3 of 5
(5,313 Views)

Hello,

Thanks to AristoQueue, I learned a lot from your work !

I'm adding the project with this message. I'm learning about AF so I really take the time and try to do this right.

About my "Game Template" actor (Game - Actor Framework => Games => Template => Games Template), all the nested actors are highly coupled with there caller...
For this moment, I think that is not a problem right ? All actors souldn't be zero coupled ?

In my mind, the next step will be transform "Game Template" a plug in and launch it by "Game selector" (Game - Actor Framework =>Game Selector).

But I don't know if I really thought my actors as I should ?

 


@AristosQueue (NI) wrote:

Each (properly designed!) actor is completely self-sufficient... 


Thanks for the advices !


Loïc.W

0 Kudos
Message 4 of 5
(5,288 Views)

@Loïc.W wrote:

For this moment, I think that is not a problem right ? All actors souldn't be zero coupled ?


Totally fine. It is your call as an architect what your priorities are for any design. I've designed systems that are tightly coupled, loosely coupled, and zero coupled, all depending upon the circumstances. The only wrong decision is to just let the decision happen without thinking about it! 🙂

 

Self-sufficient doesn't mean zero-coupled. Self-sufficient means that each one knows only about its caller and its immediate nested actors. It has no knowledge of siblings, and there's no short-circuiting the actor tree by passing Enqueuers inside messages.

0 Kudos
Message 5 of 5
(5,281 Views)