https://kotlinlang.org logo
Title
i

igor.wojda

11/22/2018, 5:27 PM
Android project:
Koin
or
Kodein
and why?
j

jmfayard

11/22/2018, 5:30 PM
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

emily

11/22/2018, 7:02 PM
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

jmfayard

11/22/2018, 7:17 PM
Dagger is the successor of Guice on Android
i

igor.wojda

11/22/2018, 7:25 PM
@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

sanogueralorenzo

11/22/2018, 7:26 PM
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

igor.wojda

11/22/2018, 7:27 PM
ViewModel support is as strong Point @sanogueralorenzo
👏 1
e

emily

11/22/2018, 7:28 PM
Thanks for explanation @jmfayard and @igor.wojda.
e

egorand

11/23/2018, 4:51 AM
Guice uses reflection, which can be slow on Android. Dagger 2 is entirely codegen-based.
g

gildor

11/23/2018, 5:53 AM
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

jmfayard

11/23/2018, 6:56 AM
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