DIY Dependency Injection with Kotlin
summary
Claims a workable DIY dependency injection pattern in Kotlin that avoids annotation processing and code generation and keeps builds fast for an SDK used across apps (15 million users referenced). Implements nested graphs, constructor injection where possible, by lazy initialization, simple factory lambdas, Retrofit and an on-device WireMock server, coroutines and multi-module structure. Demonstrates a ShoppingApp sample, swaps live versus mock endpoints, achieves fast iteration and testing with ~80% coverage, and shows the approach actually runs.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 1:11Why DIY DI
- 3:41SDK requirements
- 5:45Why use dependency injection in Android
- 8:09Inversion of control
- 10:38Existing DI libraries
- 12:41DIY DI in Kotlin
- 14:45Live demo: dependency swapping
- 16:34Dependency graphs
- 19:02Nested and lazy graphs
- 21:50Advanced DI features
- 22:53DI in Activities/Fragments
- 24:58Accessing dependency graph
- 26:21Pro tips for DIY DI
- 27:22Injecting presenters/repositories
- 28:03Key takeaways and closing remarks
related talks
35mDIY Dependency Injection with Kotlin
37mAdvanced multi-platform dependency injection
47mSimple Dependency Management in Kotlin
49mDependency injection from zero to hero with Koin
21mMinimalist Dependency Injection in Kotlin
44mFurther with Kotlin!
31mKoin in Action - Dependency Injection for Kotlin
43mDependency injection from zero to hero with Koin
