~/talk

Composing ViewModels: Breaking ViewModels into smaller self-contained UI models

Talkat droidcon Berlin 2023 · 2023-07-05..07-07· [frontend-architecture, android]
slides:none on file

A new architecture called microfeatures breaks monolithic ViewModels into host-agnostic UI models plus composables, wired by factory APIs and Dagger and exposing StateFlow and one-time actions; teams keep only one Jetpack ViewModel at the home root while composing many platform-independent UI models, enabling eight teams to share a single home screen and reuse about 80-90% of existing domain code. Implementations use composable factory lambdas, favor Kotlin Multiplatform compatibility, and plan codegen to reduce factory boilerplate.

AI-written summary · about

  1. 0:00Introduction to talk
  2. 3:16New UI design challenge
  3. 8:55Paradigm shift to micro features
  4. 10:18What is a micro feature
  5. 13:29UI model vs ViewModel
  6. 15:37Unidirectional data flow in micro features
  7. 17:27Micro feature blueprint
  8. 19:36Implementing a micro feature
  9. 25:14Hosts and composition
  10. 27:03Home screen composition
  11. 29:09Integrating composables in hosts
  12. 31:40Composition tree overview
  13. 32:03When to use micro features
  14. 33:07Pitfalls of micro features
  15. 34:11Future possibilities
  16. 38:48Conclusion and next steps
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.