Replies: 10 comments 2 replies
-
Should we consider Koin instead? If we truly want to go multiplatform? There are performance tradeoffs between these DI frameworks. Build times will be faster with Koin but that shouldn't be the sole reason for it... Let's chat more about this 😃 |
Beta Was this translation helpful? Give feedback.
-
If you want something like dagger that supports multiplatform 😉 https://github.com/evant/kotlin-inject |
Beta Was this translation helpful? Give feedback.
-
Hm, Hilt / Dagger would only be possible for Android. But this is a multiplatform project. I personally think the project should just use custom DI. Using the same solution for the whole project, even shared code. With Kotlin's default parameter values it's pretty simple, less overhead. |
Beta Was this translation helpful? Give feedback.
-
I would recommend, using Koin. It has support for multiplatform |
Beta Was this translation helpful? Give feedback.
-
I really don't see the benefit of using Koin. You still have to write modules. Kotlin's default parameter values solve 90% of all DI needs imho. In my personal project I was using Koin before, then migrated to custom DI and was saving so much lines of code 🤩 |
Beta Was this translation helpful? Give feedback.
-
Just have a look here, another project of mine, where I removed Hilt and replaced it with custom DI. Look at how much LOC I could save 🤩 For everything where default parameters are not sufficient, I use objects that I call containers (examples here and here). |
Beta Was this translation helpful? Give feedback.
-
My vote is to use https://github.com/evant/kotlin-inject It is to the jsr330 spec and works in kmp. Plus Evan is here to do support if it fails 😆 |
Beta Was this translation helpful? Give feedback.
-
I vote for koin, since it is the solution I had less trouble with in different KMP/KMM project. |
Beta Was this translation helpful? Give feedback.
-
I generally default to Koin for KMP, but we did the old memory model implementation of Koin, so there's kind of a historical reason. |
Beta Was this translation helpful? Give feedback.
-
⛔️ This discussion is closed. Please vote or check for results. |
Beta Was this translation helpful? Give feedback.
-
Description
Set up Hilt (or Dagger) library for dependency injection
Additional Information
No response
Beta Was this translation helpful? Give feedback.
All reactions