There are usecases where I believe is is not optimal to keep ActorRefs in 
messages. Such a usecase would be an active record pattern usecase where 
each actor instance represent a business entity. If you then have hundreds 
or thousands of these actor instances, it is not feasible to keep actorrefs 
of all the actors representing the business entities. Instead I believe it 
would be better to enforce actor pathnames on these business entities based 
on their "primary keys" and use actorSelection to resolve the enitities you 
want to send messages to. This would be equivalent to looking up a business 
entity from a sql database using the primary key.


On Thursday, May 15, 2014 8:29:04 AM UTC+2, Björn Antonsson wrote:
>
> Hi Chanan,
>
> Yes, it states that you shouldn't distribute shared knowledge about your 
> actor hierarchy throughout your program code. That is orthogonal to if you 
> use an ActorRef or an ActorSelection to communicate. I think that it 
> depends on your usage patterns and sometimes, especially during 
> bootstrapping of a system you might need and ActorSelection to start of the 
> communication to some named service provided by another actor.
>
> I completely agree that if you intend to have a direct conversation with 
> an actor, then you can exchange ActorRefs. Sorry if that was unclear in my 
> previous reply.
>
> B/
>
> On 14 May 2014 at 18:50:44, Chanan Braunstein 
> ([email protected]<javascript:>) 
> wrote:
>
> Ketil & Bjorn, 
>
> If you look at the second post in this thread from Viktor, it seems his 
> recommendation is the opposite. 
>  --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: 
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups 
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> To post to this group, send email to [email protected]<javascript:>
> .
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>
> -- 
> *Björn Antonsson*
> Typesafe <http://typesafe.com/> – Reactive <http://reactivemanifesto.org/> 
> Apps 
> on the JVM
> twitter: @bantonsson <http://twitter.com/#!/bantonsson>
>
> JOIN US. REGISTER TODAY! <http://www.scaladays.org/>
> Scala <http://www.scaladays.org/>
> Days <http://www.scaladays.org/>
> June 16th-18th, <http://www.scaladays.org/>
> Berlin <http://www.scaladays.org/>
>
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to