Fragmented - Android Developer Podcast

246 - Dependency Injection: Kotlin Inject with Fred Porciúncula

May 29, 2023
Ask episode
AI Snips
Chapters
Transcript
Episode notes
ANECDOTE

Planet Wild Went Full KMP

  • Fred's team went all-in on KMP for a new app, sharing everything except UI.
  • They needed DI because presenters and view models shouldn't create their own dependencies.
INSIGHT

Compile-Time Safety Without JVM Lock-In

  • Kotlin Inject gives compile-time safety similar to Dagger while being Kotlin-multiplatform friendly.
  • The team chose it because they valued compile-time guarantees and Dagger-like APIs for safety and familiarity.
INSIGHT

DI As A Lighter Alternative To expect/actual

  • Use DI in KMP to bind platform-specific implementations to common interfaces instead of expect/actual when suitable.
  • This simplifies testing and lets each platform provide implementations via the DI graph.
Get the Snipd Podcast app to discover more snips from this episode
Get the app