Reactive Clean Architecture with Android Architecture Components
Article Summary
Lucia Payo from N26 reveals how combining RxJava, Clean Architecture, and Android Architecture Components created a system where code writes itself faster over time. The secret? Infinite data streams that never complete.
N26's Android team built a reactive architecture that treats core app data as永久 observable streams rather than one-off API calls. This approach separates concerns across three layers (Data, Domain, Presentation) while using RxJava to handle asynchronous complexity and Android's ViewModel/LiveData for the UI.
Key Takeaways
- Reactive Store provides infinite streams that emit updates whenever data changes
- Repository exposes Get, Fetch, Request, Push operations with different reactive types
- Raw-to-safe entity mapping catches API contract violations before they corrupt app state
- ViewModels coordinate but delegate to mappers, providers, and utilities for smaller classes
- RetrieveInteractor guarantees values by auto-fetching when store emits NONE
Critical Insight
N26's reactive clean architecture makes features easier to navigate, code faster to review, and development progressively faster as reusable components accumulate.