dikt
Simple and powerful DI for kotlin multiplatform (by sergeshustoff)
Kodein
Painless Kotlin Dependency Injection (by kosi-libs)
Our great sponsors
dikt | Kodein | |
---|---|---|
7 | 3 | |
140 | 3,131 | |
- | 0.4% | |
6.0 | 6.0 | |
6 months ago | 22 days ago | |
Kotlin | Kotlin | |
MIT License | MIT License |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
dikt
Posts with mentions or reviews of dikt.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-09-02.
- Alternative to Hilt for KMM but not Koin
-
Multiplatform dependency injection libraries equivalent to Dagger/Anvil
You might want to check this out https://github.com/sergeshustoff/dikt. The repo also lists other alternatives that you can look into.
-
best compiler plugins?
Here is my di compiler plugin https://github.com/sergeshustoff/dikt. Half the time I had no idea what the hell I'm doing with all that undocumented API.
- Yet another DI for kotlin multiplatform
- Jet another kmp DI
- Yet another DI library, bit this time it's not a service locator
Kodein
Posts with mentions or reviews of Kodein.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-11-09.
-
Kodein VS MocKMP - a user suggested alternative
2 projects | 9 Nov 2022
-
Do we really need to use Dependency Injection Framework?
Now I will finish up saying Hilt is just an opinionated way to dependency injection on Android, but there are simpler frameworks out there such as Koin or Kodein that can help take away a lot of the troubles that can come when you try to make your own framework. Just know that most other frameworks tend to be runtime injection instead of compile time injection like Hilt, which can be helpful to know at compile time if you are missing a dependency in your graph as opposed to runtime when its out in the wild.
-
Yet another DI library, bit this time it's not a service locator
Long answer: My pain mostly comes from using [Kodein](https://github.com/Kodein-Framework/Kodein-DI/) and a custom service locator in an iOS/Swift project. Other than that I have very little experience with DI (e.g. I never used Dagger so far), so my opinion might be a little biased. Also, both of these projects are really large, so, in many cases, a class is declared in one module but used in a completely different module and the DI or service locator is sort of the glue between the modules.
What are some alternatives?
When comparing dikt and Kodein you can also consider the following projects:
kotlin-inject - Dependency injection lib for kotlin
koin - Koin - a pragmatic lightweight dependency injection framework for Kotlin & Kotlin Multiplatform
anvil - A Kotlin compiler plugin to make dependency injection with Dagger 2 easier.
kotlin-guice - Guice DSL extensions for Kotlin
motif - A simple DI API for Android / Java
injekt
kapsule - Minimalist dependency injection library for Kotlin.
KODI - light-weight KOtlin Dependency Injection (KODI)
kotlin-guiced - Convenience Kotlin API over the Google Guice DI Library
Katana - Lightweight, minimalistic dependency injection library for Kotlin & Android
Kodein-DB - Multiplatform NoSQL database
kodeinject - :gear: Constructor dependency injection for Kodein.