-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
199 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,32 @@ | ||
<img alt="KODEIN" src="https://raw.githubusercontent.com/kosi-libs/Kodein/master/doc/modules/ROOT/images/kodein-di-logo.svg" width="700"> | ||
|
||
[![Kotlin](https://img.shields.io/badge/Kotlin-1.8.20-blue.svg?style=flat&logo=kotlin)](https://kotlinlang.org) | ||
[![Maven Central](https://img.shields.io/maven-central/v/org.kodein.di/kodein-di)](https://mvnrepository.com/artifact/org.kodein.di/kodein-di) | ||
![Github Actions](https://github.com/kosi-libs/Kodein/workflows/build%20and%20publish%20a%20snapshot/badge.svg) | ||
[![Kotlin](https://img.shields.io/badge/Kotlin-1.9.21-blue.svg?style=flat&logo=kotlin)](https://kotlinlang.org) | ||
![Github Actions](https://github.com/kosi-libs/Kodein/actions/workflows/snapshot.yml/badge.svg) | ||
[![MIT License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/kosi-libs/Kodein/blob/master/LICENSE.txt) | ||
[![Slack channel](https://img.shields.io/badge/Chat-Slack-green.svg?style=flat&logo=slack)](https://kotlinlang.slack.com/messages/kodein/) | ||
|
||
KOtlin DEpendency INjection | ||
=========================== | ||
|
||
**_KODEIN_** is a very simple and yet very useful dependency retrieval container. it is very easy to use and configure. | ||
**_KODEIN_** is a straightforward and yet very useful dependency retrieval container. it is effortless to use and configure. | ||
|
||
**_KODEIN_** works: | ||
**_KODEIN_** works on all Kotlin Multiplatform targets: | ||
|
||
- On the JVM. | ||
- On Android. | ||
- On Javascript (both in the browser and on Node.js). | ||
- On Native platforms (such as iOS). | ||
- JVM / Android. | ||
- all Native platforms (iOS, macOS, Linux, Windows, WebAssembly). | ||
- Javascript / WasmJs. | ||
|
||
**_KODEIN_** allows you to: | ||
|
||
- Lazily instantiate your dependencies when needed | ||
- Stop caring about dependency initialization order | ||
- Easily bind classes or interfaces to their instance or provider | ||
- Easily debug your dependency bindings and recursions | ||
- Bind classes or interfaces to their instance or provider | ||
- Debug your dependency bindings and recursions | ||
|
||
**_KODEIN_** provides extensions to be integrable into: | ||
|
||
- [Android](https://developer.android.com/) | ||
- [Compose (Android / Desktop)](https://kosi-libs.org/kodein/7.19/framework/compose.html) | ||
- [Compose (Android / Desktop / Web)](https://kosi-libs.org/kodein/7.21/framework/compose.html) | ||
- [Ktor](https://ktor.io/) | ||
- [TornadoFX](https://tornadofx.io/) | ||
|
||
An example is always better than a thousand words: | ||
|
||
|
@@ -52,97 +48,122 @@ class Controller(private di: DI) { | |
- It integrates nicely with Android | ||
- It proposes a very kotlin-esque idiomatic API | ||
- It is fast and optimized (makes extensive use of `inline`) | ||
- It can be used in plain Java | ||
|
||
Kotlin & JVM compatibility | ||
Installation | ||
--------- | ||
|
||
| Kodein | Kotlin | JDK | Compose | | ||
|:-----------:|:------:|:-------:|:------------------:| | ||
| 7.21.0 | 1.8.20 | min 17 | Compatible | | ||
| 7.20.1 | 1.8.10 | min 1.8 | Compatible | | ||
| 7.19.0 | 1.8.10 | min 1.8 | Compatible | | ||
| 7.18.0 | 1.8.0 | min 1.8 | Compatible | | ||
| 7.17.1 | 1.8.0 | min 1.8 | Compatible | | ||
| 7.17.0 | 1.8.0 | min 1.8 | No | | ||
| 7.16.0 | 1.7.20 | min 1.8 | Compatible | | ||
| 7.15.1 | 1.7.20 | min 1.8 | Compatible (no JS) | | ||
| 7.15.0 | 1.7.20 | min 1.8 | No | | ||
| 7.14.0 | 1.7.10 | min 1.8 | Compatible | | ||
| 7.13.1 | 1.7.0 | min 1.8 | Compatible | | ||
| 7.13.0 | 1.7.0 | min 1.8 | No | | ||
| 7.12.0 | 1.6.21 | min 1.8 | Compatible | | ||
| 7.10.0 | 1.6.10 | min 1.8 | Compatible | | ||
| 7.7+ | 1.5+ | min 1.8 | Compatible | | ||
| 7.6+ | 1.5+ | min 1.8 | - | | ||
| 7.1+ | 1.4+ | min 1.8 | - | | ||
| 7.0+ | 1.3.72 | min 1.8 | - | | ||
| 6.5.5 | 1.3.72 | min 1.8 | - | | ||
| 6.5.4 | 1.3.71 | min 1.8 | - | | ||
| 6.5.3 | 1.3.70 | min 1.8 | - | | ||
| 6.5.0 | 1.3.61 | min 1.8 | - | | ||
| 6.4.1 | 1.3.50 | min 1.8 | - | | ||
| 6.3+ | 1.3.40 | min 1.8 | - | | ||
| 6.2+ | 1.3.30 | 1.6 | - | | ||
| 6.1+ | 1.3.20 | 1.6 | - | | ||
| 6.0+ | 1.3.0 | 1.6 | - | | ||
| 5.0+ | 1.2.30 | 1.6 | - | | ||
| 4.1+ | 1.1.3 | 1.6 | - | | ||
| 4.0.0-beta2 | 1.1.0 | 1.6 | - | | ||
|
||
Read more | ||
--------- | ||
Kodein is available on Maven Central. | ||
|
||
```kotlin | ||
repositories { | ||
mavenCentral() | ||
} | ||
``` | ||
|
||
```kotlin | ||
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 documentation](https://kosi-libs.org/kodein/)** | ||
|
||
|
||
Kotlin & JVM compatibility | ||
--------- | ||
|
||
| Kodein | Kotlin | JDK | | ||
|:-----------:|:------:|:-------:| | ||
| 7.21.+ | 1.9.+ | min 1.8 | | ||
| 7.20.1 | 1.8.10 | min 1.8 | | ||
| 7.19.0 | 1.8.10 | min 1.8 | | ||
| 7.18.0 | 1.8.0 | min 1.8 | | ||
| 7.17.1 | 1.8.0 | min 1.8 | | ||
| 7.17.0 | 1.8.0 | min 1.8 | | ||
|
||
> Full table can be found [here](https://kosi-libs.org/kodein/7.21/core/platform-and-genericity.html) | ||
Support | ||
------- | ||
|
||
Support is held in the [Kodein Slack channel](https://kotlinlang.slack.com/messages/kodein/) | ||
(you can get an invitation to the Kotlin Slack [here](https://slack.kotlinlang.org/)). | ||
|
||
Testimonies | ||
----------- | ||
[//]: # (Testimonies) | ||
|
||
[//]: # (-----------) | ||
|
||
[//]: # () | ||
[//]: # ( ) | ||
|
||
[//]: # () | ||
[//]: # (> At [Collokia](https://www.collokia.com/) we use Kodein in all of our backend service infrastructure and all modules in those services are loosely coupled through injection with Kodein.) | ||
|
||
[//]: # (> It allows us to have nice module independence, and to opt-out of injection during testing or build separate modules in support of testing. ) | ||
|
||
[//]: # (> It is a key component and building block in our architecture. ) | ||
|
||
[//]: # (> -- [Jayson Minard](https://github.com/apatrida)) | ||
|
||
[//]: # () | ||
[//]: # ( ) | ||
|
||
[//]: # () | ||
[//]: # (> At [Moovel Group GmbH](https://www.moovel.com/de/en), we have successfully used the wonderful Kodein library into in [this Android app](https://play.google.com/store/apps/details?id=com.daimler.moovel.android).) | ||
|
||
[//]: # (> As we improved it, we found Kodein to be much more useful than Dagger2 as it simplified our code throughout. ) | ||
|
||
[//]: # (> Kodein is in my view, much easier to understand, doesn't have that nasty ceremony, and has really nice debug messages. ) | ||
|
||
[//]: # (> We are also working now on other projects where we are using Kodein as well. ) | ||
|
||
[//]: # (> -- [Sorin Albu-Irimies](https://github.com/sorinirimies)) | ||
|
||
[//]: # () | ||
[//]: # ( ) | ||
|
||
[//]: # () | ||
[//]: # (> Kodein has been instrumental in moving our entire production application to Kotlin at [InSite Applications](https://insiteapplications.com). It uses standard Kotlin idioms and features for ultimate clarity and simplicity. It was clear to us from the beginning that Kodein would be our DI solution. Our devs love it so much that they've transitioned to using it in their personal apps, both Java and Kotlin! ) | ||
|
||
| ||
[//]: # (> -- [Eliezer Graber](https://github.com/eygraber)) | ||
|
||
> At [Collokia](https://www.collokia.com/) we use Kodein in all of our backend service infrastructure and all modules in those services are loosely coupled through injection with Kodein. | ||
> It allows us to have nice module independence, and to opt-out of injection during testing or build separate modules in support of testing. | ||
> It is a key component and building block in our architecture. | ||
> -- [Jayson Minard](https://github.com/apatrida) | ||
[//]: # () | ||
[//]: # ( ) | ||
|
||
| ||
[//]: # () | ||
[//]: # (> At [Compsoft Creative](https://www.compsoft.co.uk), Kodein is central our new Kotlin based app architecture, giving us a solid underpinning to all apps we develop and allowing a simple yet powerful way to de-couple our services with a library that is lightweight and perfect for mobile apps. ) | ||
|
||
> At [Moovel Group GmbH](https://www.moovel.com/de/en), we have successfully used the wonderful Kodein library into in [this Android app](https://play.google.com/store/apps/details?id=com.daimler.moovel.android). | ||
> As we improved it, we found Kodein to be much more useful than Dagger2 as it simplified our code throughout. | ||
> Kodein is in my view, much easier to understand, doesn't have that nasty ceremony, and has really nice debug messages. | ||
> We are also working now on other projects where we are using Kodein as well. | ||
> -- [Sorin Albu-Irimies](https://github.com/sorinirimies) | ||
[//]: # (> -- [Daniel Payne](https://github.com/CompsoftCreative)) | ||
|
||
| ||
[//]: # () | ||
[//]: # ( ) | ||
|
||
> Kodein has been instrumental in moving our entire production application to Kotlin at [InSite Applications](https://insiteapplications.com). It uses standard Kotlin idioms and features for ultimate clarity and simplicity. It was clear to us from the beginning that Kodein would be our DI solution. Our devs love it so much that they've transitioned to using it in their personal apps, both Java and Kotlin! | ||
> -- [Eliezer Graber](https://github.com/eygraber) | ||
[//]: # () | ||
[//]: # (> Kodein is used in [the android app of the OhelShem school](https://github.com/OhelShem/android). ) | ||
|
||
| ||
[//]: # (> -- [Yoav Sternberg](https://github.com/yoavst) ) | ||
|
||
> At [Compsoft Creative](https://www.compsoft.co.uk), Kodein is central our new Kotlin based app architecture, giving us a solid underpinning to all apps we develop and allowing a simple yet powerful way to de-couple our services with a library that is lightweight and perfect for mobile apps. | ||
> -- [Daniel Payne](https://github.com/CompsoftCreative) | ||
[//]: # () | ||
[//]: # ( ) | ||
|
||
| ||
[//]: # () | ||
[//]: # (> Kodein was created at [Dental Monitoring](https://dental-monitoring.com/) with the opinion that Dagger2 is way too verbose and complex.) | ||
|
||
> Kodein is used in [the android app of the OhelShem school](https://github.com/OhelShem/android). | ||
> -- [Yoav Sternberg](https://github.com/yoavst) | ||
[//]: # (> It is now used in almost all our projects: the server, the internal production software & the Android application. ) | ||
|
||
| ||
[//]: # (> Kodein is very easy to use and set up: it allows our team to easily share code and patterns, as well as quickly bootstrapping new ideas. ) | ||
|
||
> Kodein was created at [Dental Monitoring](https://dental-monitoring.com/) with the opinion that Dagger2 is way too verbose and complex. | ||
> It is now used in almost all our projects: the server, the internal production software & the Android application. | ||
> Kodein is very easy to use and set up: it allows our team to easily share code and patterns, as well as quickly bootstrapping new ideas. | ||
> -- [Salomon Brys](https://github.com/SalomonBrys) | ||
[//]: # (> -- [Salomon Brys](https://github.com/SalomonBrys)) | ||
|
||
| ||
[//]: # () | ||
[//]: # ( ) | ||
|
||
If you are using KODEIN, please [let us know](mailto:[email protected])! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters