Advanced multi-platform dependency injection
summary
Shows how Kodein-DI runs across Kotlin/JVM, Kotlin/Native and Kotlin/JS and what actually works: provider, factory, singleton, multiton bindings with tags and bindConstant, modules plus test-friendly override behavior, and sub-DI copy strategies that change whether singletons are shared. Demonstrates scopes (weak context vs custom registries that must clear), scope closable, rememberInstance for Compose, and a Swift/SwiftUI retrieval prototype with a Gradle plugin proof‑of‑concept plus exploration of compiler‑plugin/KSP support for dependency interface generation.
AI-written summary · about
chapters (20)
- 0:00Introduction and overview
- 1:08What is dependency injection
- 2:33Binding types in coding DI
- 6:07Injecting dependencies
- 9:46Organizing bindings with modules
- 11:13Overriding bindings for testing
- 12:38Extending DI containers
- 14:44Copy strategies for containers
- 15:27Common DI errors
- 17:32Understanding scopes
- 19:20Creating custom scopes
- 21:30Using scopes with bindings
- 22:59Context translation
- 24:03Scope closable resources
- 25:26DI with declarative UI
- 27:14Performance in Compose
- 28:17Android specific DI
- 30:20Swift UI support plans
- 33:11Future retrieval interfaces
- 36:27Closing and resources
related talks
35mDIY Dependency Injection with Kotlin
31mKoin in Action - Dependency Injection for Kotlin
29mDIY Dependency Injection with Kotlin
49mDependency injection from zero to hero with Koin
43mAndroid, Compose, Multiplatform & Server – Multiplatform Dependency Injection in Kotlin
39mInject Basics!
40mNavigating Dependency Injection with Metro
28mInsert Koin
