10/14/2015, 4:18 PM
@cedric: 1) Tags can be anything, not just Strings. So you can do something like
bind<Type>(Annotated()) with whatever
. However kodein does not do reflection (as Mark pointed out, it's more of a dependency lookup library), so to retrieve the dependency, its a parameter :
val dep = kodein.instance(Annotated())
. Therefore, Annotated() should not be an annotation but a data class (to support hashcode & equals). 2) Factory bindings are typically for assisted injection.