Questions tagged [scaldi]

Lightweight Scala Dependency Injection Library.

Scaldi provides simple and elegant way to do dependency injection in Scala.

33 questions
0
votes
1 answer

DI Binding to a subclass

I'm wondering if it's possible to bind dependencies with following syntax: bind [Environment[User, Authenticator]] to FakeEnvironment[User, SessionAuthenticator](testUser) (this was taken from tests, actual binding in the Module is slightly more…
Mironor
  • 1,157
  • 10
  • 25
0
votes
2 answers

why cant I bind to single actor instance (akka router) with scaldi?

I´m currently struggeling with implementing my Akka router logic using scaldi for dependency injection. Why cant I bind to a single actor instance with scaldi, since my actor is a router and I only want to have one single instance of it? The way I…
heiningair
  • 441
  • 1
  • 6
  • 23
0
votes
2 answers

Scala - how to cast Option[X] to Option[y]

I have simple service classes trait ItemService[+A] { def getItem(id: Int): Option[A] } class MockItemService(implicit inj: Injector) extends ItemService[Item] with Injectable { def getItem(id: Int) = { Option(new Feature("My…
AdiFatLady
  • 368
  • 1
  • 6
  • 18
1 2
3