Android project: `Koin` or `Kodein` and why?
# announcements
i
Android project:
Koin
or
Kodein
and why?
j
Kodein
over
dagger
because - I understand what it does - It has good documentation - It does not break my incremental builds with
kapt
- dagger has more features but YAGNI
Kodein
over
Koin
because ... well I have tried Kodein first and it solve my needs.
👍 2
e
how about Guice? I just started a new server project ktor + guice and it seems to be doing well. I come from spring background so Guice is also new to me.
j
Dagger is the successor of Guice on Android
i
@emily In the old days Android community moved to Dagger as it has many advantages over Guice: - Very clean stacktrace - Generated code is readable, almost identical to the code you would write yourself (I see Guice project is still maintained, so I don’t knwo how it compares nowdays, however I haven’t heard about any Android project using it)
s
Interesting, I went with Koin instead of Kodein because I find the documentation a bit more friendly and also because of the android viewmodel integration.
i
ViewModel support is as strong Point @sanogueralorenzo
👏 1
e
Thanks for explanation @jmfayard and @igor.wojda.
e
Guice uses reflection, which can be slow on Android. Dagger 2 is entirely codegen-based.
g
Dagger is the successor of Guice on Android
Dagger2 is not something Android specific. They got some Android related features only recently as separate library
j
True but what I meant is that it was done by the same guy (Jesse Wilson) after he realized that some shortcomings of the Android platform made Guice not suitable on Android, and dagger was written specifically to adress those. So there is no point in using Guide over Dagger on Android IMHO