Android-Apps profitieren von Architekturmustern, die Concerns trennen und Wartbarkeit sowie Testbarkeit verbessern — insbesondere MVVM (Model-View-ViewModel, Googles Empfehlung), MVI (Model-View-Intent) und Clean Architecture. Ihr Verständnis ist wichtig für den Aufbau gut strukturierter Apps.
MVVM — Model-View-ViewModel (empfohlen)
MVVM separates the UI from logic and data:
VIEW (Activity/Fragment/Compose) → displays UI, observes the ViewModel, forwards events
VIEWMODEL → holds UI state + logic; exposes observable state (LiveData/StateFlow);
survives config changes; NO Android framework/UI dependencies (testable)
MODEL → data (repositories, data sources)
→ The View observes the ViewModel's state and updates reactively. Google's recommended
pattern (using Architecture Components).
