Breaking ViewModels into smaller self-contained UI models
summary
A scalable “micro feature” architecture breaks large ViewModels into platform‑independent host‑agnostic UI models paired with reusable Compose composables, created by API/impl factories and wired via a parent Jetpack ViewModel that supplies coroutine scope and saved state. Implementation uses Dagger assisted factories to instantiate UI models, supports KMP migration and server‑driven layouts, and applies unit, screenshot, integration and end‑to‑end tests. The team ships production: 75 micro features across 6 hosts, delivered by 7 teams (30 engineers), and the migration succeeds on Android and iOS.
AI-written summary · about
chapters (15)
- 0:00Scalable UI architecture intro
- 3:37UI design challenges
- 6:30ViewModel limits
- 8:16Micro features architecture
- 10:29UI models vs ViewModels
- 14:50Unidirectional data flow
- 16:15Micro feature blueprint
- 18:05Micro feature example
- 24:05Hosts and integration
- 30:31Scaling with configs
- 34:49Multiplatform benefits
- 36:55Server-driven UI
- 37:58Testing micro features
- 39:01Key learnings
- 40:04Results and roadmap
related talks
40mComposing ViewModels: Breaking ViewModels into smaller self-contained UI models
40mComposing ViewModels:Breaking ViewModels into smaller self-contained UI models
35mBreaking Up with Big ViewModels
29mModern Android Development using MVI architecture
22mBloated ViewModels? What Next
38mArchitecture Agnostic UI Development
38mViews, Compose, Multiplatform - Oh My!
43mHelp! ViewModel
