Actor's Path versus Reference
In this section, we will compare the two important components of an Akka Actor:
ActorRef:ActorRefis a reference of an Actor object. When we create an Actor usingActorSystem, it returnsActorRefbut not an Actor object:
val actorRef:ActorRef =
actorSystem.actorOf(Props[SimpleActor],"SimpleActor") As the outside world cannot interact with an Actor object directly, an outside Actor or a non-Actor can interact with another Actor indirectly using this ActorRef. When we create another Actor, ActorSystem returns a different ActorRef to that newly created Actor.
ActorRef is the same for a single Actor. It does not change during an Actor lifecycle. Two different Actor objects cannot have the same ActorRef.
ActorPath:ActorPathis the address of an Actor in theActorSystem. In Akka, Actors are created in the hierarchy fashion, so each Actor in that hierarchy has a different address to reference that Actor uniquely.

As shown in the preceding diagram, Actor...