I'm looking for some good tutorial or github code ...
# android
a
I'm looking for some good tutorial or github code about Dagger 2 for Android app written in Kotlin
K 1
r
Take a look mine.
e
I think you can take a look at
Kodein
, it is a better DI library for Kotlin
4
2
m
not compile time validated tho
g
Kodein and Dagger are very different. And Kodein actually not a DI at all, but service locator
💯 1
s
@edwardwongtl Do you have an example project? Dagger is quite handy with @Inject constructor in kotlin
r
take a look my repo
g
This repo from @kboyarshinov that contains some advanced examples of Dagger usage for Android App based on dagger-android https://github.com/kboyarshinov/advanceddagger2
s
I was asking for Kodein example since I've only played around with it 😄
e
I don't have an example project in hand by now, but you can take a look at Kodein's page to get a feel of how to use it. https://salomonbrys.github.io/Kodein/
And i think dagger2 has too much boilerplate code, maybe the cause is dagger is designed with&for java in the first place. Just a personal feel, no offense. 😀
s
I already had a look at those, was looking more for a mvvm mvp example with the different layers in place
I felt the same about dagger but when I found out about @Inject constructor I got rid of most of the boilerplate
e
But still creating a bunch of
@Provide
,
@Module
and `@Component`class & interface is too verbose for me, however dagger2 does allow easy unit testing...
r
@edwardwongtl yes. dagger using annotation processor then create a generate code based on that annotate.
i dont know, if you can achieve such ways without annotate.