Architecting an app with MVP and ViewModels
summary
SeatGeek refactors MVP into an explicit unidirectional flow called MVMVP that moves state out of presenters into Android ViewModel + Kotlin data classes, uses BehaviorRelay and RxJava for observable state, and exposes a single mutation API — sendToViewModel reducers — to serialize updates. Activities observe the ViewModel (or use Android Data Binding to render state) so presenters shrink to event handlers; testing stays similar, async scheduling is controlled in tests, and the pattern reduces view-state bugs and survives config changes.
AI-written summary · about
chapters (14)
- 0:00Introduction and background
- 1:54Demo app setup
- 2:57Basic MVP implementation
- 6:05Adding async to MVP
- 10:39Challenges with async MVP
- 12:46Introducing ViewModel
- 15:54Integrating ViewModel with MVP
- 18:45MVMVP contract and state
- 20:51Presenter implementation
- 21:34Activity with ViewModel
- 23:21Drawbacks of MVMVP
- 24:28Simplifying with data binding
- 27:14Data binding setup
- 28:38Alternatives and summary
related talks
41mMVI: a Robust and Modern Architecture
34mMVWTF: Demystifying Architecture Patterns
36mMVWTF: Demystifying Architecture Patterns
42mHands on MvRx: Building Real Apps
35mBuilding better Android apps with MVP
38mHands On MvRx: Building Real Apps
33mModel-View-Intent for
39mClean app design with Architecture Components
