I'm not asking for opinion here but facts
I'm trying to pick a new DI. I have had some experience with Guice. Overall i would said that one advantage of it, is that when from scala you need to integrate with Java, Guice does the job. So for interoperability it's a clear plus.
If we put aside this interoperability issue, can anyone, give me a brief comparison between
scaladi, guice, Macwire?
I'm still new at understanding scaldi. One thing that i found surprising is the idea of having to move around around your injector trough an implicit parameter. I never almost did that in guice. I either wire up everything in my main, or use assisted injection, hence passing around the factories to the class that needs some specific instance.
If someone could further elaborate on that design choice i would appreciate.
Many thanks,
-M-
Here is something strange i found with macWire:
trait Interf {
def name:String
}
class InterfImpl(val name:String) extends Interf
trait AModule {
import com.softwaremill.macwire.MacwireMacros._
//lazy val aName: String = "aName"
lazy val theInterf: Interf = wire[InterfImpl]
}
object injector extends AModule
println(injector.theInterf.name)
I get a strange value. I don't know what macWire is doing at that level. I though it could make a compile error or something. Indeed, i did not give any String value.