Getting big payouts with Koin
summary
Demonstrates using Koin 2.0 as a Kotlin service-locator to wire an Android single-screen app: ViewModel with a repository and a user ID, repository built from a Room DAO (needs application context) and a Retrofit service (needs OkHttp and base URL). Shows modules, factory vs single, scoped lifecycles tied to screens, startKoin/global context and lazy viewModel injection, and overriding modules to supply mocked DAO/service for hermetic tests. Presents checkModules to validate runtime wiring (no compile-time guarantees) and reports the approach works and speeds test setup.
AI-written summary · about
chapters (13)
- 0:00Introduction to Koin
- 3:48Service locators vs DI
- 9:31Introducing Koin library
- 13:50Global context and DSL
- 16:42Setting up modules
- 20:00Constructor injection
- 23:12Singleton and efficiency
- 24:15Retrieving dependencies
- 25:18ViewModel integration
- 27:01Passing parameters
- 28:49Scoped dependencies
- 31:17Testing with Koin
- 33:23Compile safety
related talks
36mInvesting in Koin
47mAndroid Architecture Design with Koin
45mDependency Injection from Zero to Hero
39mInject your Jetpack Compose Application with Koin
39mInject Basics!
41mMaking a Kotlin, Architecture Components, Rx and Coroutines sandwich
01h 03mLive App Architecture Debugging with Kotzilla & Koin
41mAndroid, Compose, MP & Server - Inject them all with Coin
