Jump to content

Child actors and private messages intended only for self-enqueuing


Recommended Posts

I created a parent Actor with a set of Messages that I wanted to restrict to self-enqueuing only; I don't want the caller or any other actor to be able to request those methods.

To accomplish this, I set those Messages to private scope inside the Actor LVLIB.

I'm now creating a child Actor which overrides some of the functionality of the parent. However, I'd like for the child Actor to be able to have access to the self-enqueuing messages of the LVLIB. I still don't want the caller or any other actor to be able to request those methods. Essentially, I want these messages to have the equivalent of "protected" scope.

Since I can't actually set them to "protected," I'm considering the following options.

  • [*]Make the Messages public. Enforce encapsulation by "remembering" that the caller should never enqueue any of these messages.
      [*]Set the Messages to community. Add the necessary friend relationships between Actors to allow the child Actor access. Don't really like using community scope in general because it feels hard to maintain.
      [*]Put the child Actor class into the same LVLIB as the parent, so that they share access to the private messages. Show organization using virtual folders (one called "Messages for Parent" and the other "Messages for Child X" or similar). Concerned this could complicate things in ways I don't anticipate. For example, what if I want to create self-enqueued messages that are only available to the child Actor? Are these now automatically available to the parent?

Are any of these the right solution? What have others done in the past and is there an established best practice?

Thanks.
 

EDIT: I see this question has ]been answered here. It seems like a lot of overhead to create a protected message but I guess it's also the cleanest way to go.

Edited by Mike Le
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.