title: Scala Play 2 Guice dependency injection with traits
body: <p>In my application I have the following traits/concrete classes:</p>
  
  <p>In package <code>models.daos</code>:</p>
  
  <pre><code>trait UserDAO // UserDAO.scala
  class UserDAOImpl @Inject() (app: play.api.Appliction) extends UserDAO // UserDAOImpl.scala
  </code></pre>
  
  <p>In package <code>controllers</code>:</p>
  
  <pre><code>class Application @Inject() (userDao: UserDAO) extends Controller
  </code></pre>
  
  <p>However, when I run the app I get:</p>
  
  <pre><code>ProvisionException: Unable to provision, see the following errors:
  
  1) No implementation for models.daos.UserDAO was bound.
    while locating models.daos.UserDAO
      for parameter 0 at controllers.Application.&lt;init&gt;(Application.scala:15)
    while locating controllers.Application
      for parameter 1 at router.Routes.&lt;init&gt;(Routes.scala:31)
    while locating router.Routes
    while locating play.api.inject.RoutesProvider
    while locating play.api.routing.Router
  </code></pre>
  
  <p>I'm new to dependency injection and don't really know how to tell Guice to use the concrete class.</p>