arnaud.giuliani
05/10/2019, 6:07 AMmodule {
single { Simple.Component1() } bind Simple.ComponentInterface1::class
single { Simple.Component2() } bind Simple.ComponentInterface1::class
single { Simple.UserComponent(bind<Simple.Component1, Simple.ComponentInterface1>()) }
}
- you can get directly the instances with get<Simple.Component1>()
, get<Simple.Component2>()
- get<Simple.ComponentInterface1>()
will throw an error and tell you to use bind
because can’t choose between the 2 definitions
- you can use bind<>()
to resolve a component in the DSL
- getAll<Simple.ComponentInterface1>()
give us the 2 instancessloydev
05/10/2019, 6:50 AMval instance: Simple.ComponentInterface1 = bind<Simple.Component1, Simple.ComponentInterface1>()
, is that right?arnaud.giuliani
05/10/2019, 7:13 AMsloydev
05/10/2019, 7:14 AMsloydev
05/10/2019, 7:14 AMval instance: Simple.ComponentInterface1 = get<Simple.Component1>()
? Or just different API?arnaud.giuliani
05/10/2019, 8:10 AMkenkyee
05/10/2019, 2:03 PMarnaud.giuliani
05/10/2019, 2:09 PMarnaud.giuliani
05/10/2019, 2:10 PMFeature
or Plugin
for examplearnaud.giuliani
05/10/2019, 2:10 PMkenkyee
05/10/2019, 2:20 PM