Skip to content

Commit

Permalink
chore: update readme and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
romainbsl committed Jan 12, 2024
1 parent 78684f4 commit c9d169d
Show file tree
Hide file tree
Showing 4 changed files with 199 additions and 82 deletions.
179 changes: 100 additions & 79 deletions README.md
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:

Expand All @@ -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)

[//]: # (-----------)

[//]: # ()
[//]: # (&nbsp;)

[//]: # ()
[//]: # (> At [Collokia]&#40;https://www.collokia.com/&#41; 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]&#40;https://github.com/apatrida&#41;)

[//]: # ()
[//]: # (&nbsp;)

[//]: # ()
[//]: # (> At [Moovel Group GmbH]&#40;https://www.moovel.com/de/en&#41;, we have successfully used the wonderful Kodein library into in [this Android app]&#40;https://play.google.com/store/apps/details?id=com.daimler.moovel.android&#41;.)

[//]: # (> 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]&#40;https://github.com/sorinirimies&#41;)

[//]: # ()
[//]: # (&nbsp;)

[//]: # ()
[//]: # (> Kodein has been instrumental in moving our entire production application to Kotlin at [InSite Applications]&#40;https://insiteapplications.com&#41;. 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! )

&nbsp;
[//]: # (> -- [Eliezer Graber]&#40;https://github.com/eygraber&#41;)

> 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)
[//]: # ()
[//]: # (&nbsp;)

&nbsp;
[//]: # ()
[//]: # (> At [Compsoft Creative]&#40;https://www.compsoft.co.uk&#41;, 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]&#40;https://github.com/CompsoftCreative&#41;)

&nbsp;
[//]: # ()
[//]: # (&nbsp;)

> 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]&#40;https://github.com/OhelShem/android&#41;. )

&nbsp;
[//]: # (> -- [Yoav Sternberg]&#40;https://github.com/yoavst&#41;&nbsp;)

> 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)
[//]: # ()
[//]: # (&nbsp;)

&nbsp;
[//]: # ()
[//]: # (> Kodein was created at [Dental Monitoring]&#40;https://dental-monitoring.com/&#41; 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)&nbsp;
[//]: # (> It is now used in almost all our projects: the server, the internal production software & the Android application. )

&nbsp;
[//]: # (> 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]&#40;https://github.com/SalomonBrys&#41;)

&nbsp;
[//]: # ()
[//]: # (&nbsp;)

If you are using KODEIN, please [let us know](mailto:[email protected])!
6 changes: 3 additions & 3 deletions doc/antora.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: kodein
title: Kodein
version: '7.21'
display_version: '7.21.0'
display_version: '7.21.1'
nav:
- modules/ROOT/nav.adoc
- modules/core/nav.adoc
Expand All @@ -11,6 +11,6 @@ nav:
asciidoc:
attributes:
branch: '7.21'
version: '7.21.0'
kotlin: '1.8.20'
version: '7.21.1'
kotlin: '1.9.21'
jdk: '1.8'
80 changes: 80 additions & 0 deletions doc/modules/ROOT/pages/platform-and-genericity.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,86 @@ Also, it requires at least JDK {jdk}, for JVM projects.

_Kodein-DI_ is compatible with all platforms that the Kotlin language compiles to: JVM & compatible (Android), Javascript and all the Kotlin/Native targets.

Here is a table containing the version compatibility:

[%header,cols=3*]
|===
|Kodein
|Kotlin

|7.21.2
|Compose 1.6.0-alpha01
|1.9.21

|7.21.1
|Compose 1.5.10-dev-wasm03
|1.9.21

|7.21.0
|Compose 1.5.10-dev-wasm02
|1.9.20

|7.20.0
|Compose 1.3.1
|1.8.10

|7.19.0
|Compose 1.3.1
|1.8.10

|7.18.0
|Compose 1.3.0-rc2
|1.8.0

|7.17.1
|Compose 1.3.0-rc2
|1.8.0

|7.16.0
|Compose 1.2.0
|1.7.20

|7.15.1
|Compose 1.2.0
|1.7.20

|7.15.0
|NOT COMPATIBLE
|1.7.20

|7.15.0-kotlin-1.7.20-RC
|NOT COMPATIBLE
|1.7.20

|7.14.0
|1.2.0-alpha01-dev745
|1.7.10

|7.13.1
|1.2.0-alpha01-dev745
|1.7.0

|7.10.0
|1.0.1-rc2
|1.6.10

|7.7.0
|1.0.0-alpha1
|1.5.30

|7.6.0
|1.0.0-beta08
|1.5.21

|7.5.1
|1.0.0-beta07
|1.4.32

|7.5.0
|1.0.0-beta06
|1.4.31
|===

Since `7.0.0`, a new https://github.com/Kodein-Framework/Kodein-Type[type system] has been designed and included to _Kodein-DI_.
Thus, it appears to the developer that there is no more _obvious_ differences between platforms, you no longer have to choose between `erased` or `generic` dependencies.
Starting from `7.0.0`, _Kodein-DI_ is using the `generic` version of the type system, meaning you should be able to bind generics easily for _Kotlin/Multiplatform_ projects.
Expand Down
16 changes: 16 additions & 0 deletions doc/modules/framework/pages/compose.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@ Here is a table containing the version compatibility:
|Compose compiler
|Kotlin

|7.21.2
|Compose 1.6.0-alpha01
|1.9.21

|7.21.1
|Compose 1.5.10-dev-wasm03
|1.9.21

|7.21.0
|Compose 1.5.10-dev-wasm02
|1.9.20

|7.20.0
|Compose 1.3.1
|1.8.10

|7.19.0
|Compose 1.3.1
|1.8.10
Expand Down

0 comments on commit c9d169d

Please sign in to comment.