Mike Le Posted May 22, 2013 Report Share Posted May 22, 2013 (edited) 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 May 22, 2013 by Mike Le Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.