D I
KOtlin DEpendency INjection.
To construct a DI instance, simply use it's block constructor and define your bindings in it :
val di = DI {
bind<Dice>() with factory { sides: Int -> RandomDice(sides) }
bind<DataSource>() with singleton { SqliteDS.open("path/to/file") }
bind<Random>() with provider { SecureRandom() }
constant("answer") with "forty-two"
}Types
BindBuilder
Link copied to clipboard
Builder
Link copied to clipboard
DependencyLoopException
Link copied to clipboard
MainBuilder
Link copied to clipboard
Module
Link copied to clipboard
NoResultException
Link copied to clipboard
class NoResultException(search: SearchSpecs, message: String) : RuntimeException
Content copied to clipboard
NotFoundException
Link copied to clipboard
class NotFoundException(key: DI.Key<*, *, *>, message: String) : RuntimeException
Content copied to clipboard
OverridingException
Link copied to clipboard