
Straightforward dependency retrieval container offering lazy instantiation, binding, and debugging capabilities. Integrates with Android, Compose, and Ktor. Provides a simple, readable declarative DSL.
[!IMPORTANT]
Kodein DI will no longer receive new features. We will keep maintaining the current version and fix issues when necessary, but nothing more.
Our focus is now on Inara, a Kotlin Symbol Processor that brings compile-time dependency injection to Kotlin Multiplatform, with no runtime overhead.
If you like how Kodein works, we warmly encourage you to migrate to Koin. It supports everything Kodein does, and much more. See Introducing the Koin migration skills to get started.
KODEIN is a straightforward and yet very useful dependency retrieval container. it is effortless to use and configure.
KODEIN works on all Kotlin Multiplatform targets:
KODEIN allows you to:
KODEIN provides extensions to be integrable into:
An example is always better than a thousand words:
val di = DI {
bindProvider<Dice> { RandomDice(0, 5) }
bindSingleton<DataSource> { SqliteDS.open("path/to/file") }
}
class Controller(private di: DI) {
private val ds: DataSource by di.instance()
}KODEIN is a good choice because:
inline)Kodein is available on Maven Central.
repositories {
mavenCentral()
}kotlin {
sourceSets {
commonMain {
dependencies {
implementation("org.kodein.di:kodein-di:{version}")
}
}
}
}KODEIN 7+ is the current major version, but documentation is available for previous versions.
| Kodein | Kotlin | JDK |
|---|---|---|
| 7.27 | 2.2.+ | min 17 |
| 7.26 | 2.1.+ | min 17 |
| 7.23 | 2.0.+ | min 17 |
| 7.22 | 2.0.+ | min 11 |
| 7.21 | 1.9.+ | min 1.8 |
| 7.20 | 1.8.10 | min 1.8 |
| 7.19 | 1.8.10 | min 1.8 |
| 7.18 | 1.8.0 | min 1.8 |
| 7.17 | 1.8.0 | min 1.8 |
Full table can be found here
Support is held in the Kodein Slack channel (you can get an invitation to the Kotlin Slack here).
If you are using KODEIN, please let us know!
[!IMPORTANT]
Kodein DI will no longer receive new features. We will keep maintaining the current version and fix issues when necessary, but nothing more.
Our focus is now on Inara, a Kotlin Symbol Processor that brings compile-time dependency injection to Kotlin Multiplatform, with no runtime overhead.
If you like how Kodein works, we warmly encourage you to migrate to Koin. It supports everything Kodein does, and much more. See Introducing the Koin migration skills to get started.
KODEIN is a straightforward and yet very useful dependency retrieval container. it is effortless to use and configure.
KODEIN works on all Kotlin Multiplatform targets:
KODEIN allows you to:
KODEIN provides extensions to be integrable into:
An example is always better than a thousand words:
val di = DI {
bindProvider<Dice> { RandomDice(0, 5) }
bindSingleton<DataSource> { SqliteDS.open("path/to/file") }
}
class Controller(private di: DI) {
private val ds: DataSource by di.instance()
}KODEIN is a good choice because:
inline)Kodein is available on Maven Central.
repositories {
mavenCentral()
}kotlin {
sourceSets {
commonMain {
dependencies {
implementation("org.kodein.di:kodein-di:{version}")
}
}
}
}KODEIN 7+ is the current major version, but documentation is available for previous versions.
| Kodein | Kotlin | JDK |
|---|---|---|
| 7.27 | 2.2.+ | min 17 |
| 7.26 | 2.1.+ | min 17 |
| 7.23 | 2.0.+ | min 17 |
| 7.22 | 2.0.+ | min 11 |
| 7.21 | 1.9.+ | min 1.8 |
| 7.20 | 1.8.10 | min 1.8 |
| 7.19 | 1.8.10 | min 1.8 |
| 7.18 | 1.8.0 | min 1.8 |
| 7.17 | 1.8.0 | min 1.8 |
Full table can be found here
Support is held in the Kodein Slack channel (you can get an invitation to the Kotlin Slack here).
If you are using KODEIN, please let us know!