title: Scaldi dependency injection and Akka Actors
body: <p>I'm currently exploring using Scaldi for Dependency Injection in a Play2.2 application.</p>
  
  <p>I have read the documentation on Scaldi's website, but what is unclear to me is how to use it with Akka.</p>
  
  <p>What I have so far in my project:</p>
  
  <pre><code>Models/ (Daos and case classes)
     User.scala
  Services/  (Akka Actors)
     UserService.scala
     ProfileService.scala
  Managers/  (Regular Manager Classes)
     UserManager.scala (The Trait Interface)
     UserManagerImpl.scala (An actual implementation)
     UserManagerMock.scala (Mocked version)
     etc..
  </code></pre>
  
  <p>In UserService.scala I would use an instance of the UserManager to do the work:</p>
  
  <pre><code>class UserService extends ServiceActor with Injection
  {
      val userManager = inject[UserManager]
  
      def receive = {
          case Register(email: String, password: String)
      }
  }
  
  object UserService extends Service
  {
      case class Register(email: String, password: String)
  
      override protected val actorRef = Akka.system.actorOf(Props[UserService].withRouter(SmallestMailboxRouter(resizer = Some(resizer))))
  }
  </code></pre>
  
  <p>Then depending on the injected manager, the actor can be sort of mocked if it delegate all the work to the manager?</p>
  
  <p>However, what if the managers needs to call other Services, which are just companion objects? Or Services calling other services that are also referenced via companion objects? </p>
  
  <p>Does anyone have some pointers on how to integrate Akka with Scaldi? </p>