Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Android Clean Architecture (Lightning Talk)

Chuck Greb
September 30, 2015

Android Clean Architecture (Lightning Talk)

Lately there has been a lot of talk about clean architecture in the Android space including MVC, MVP, MVVM, and more. Let's break down some of these design patterns and talk about how one might implement them on Android.

Chuck Greb

September 30, 2015
Tweet

More Decks by Chuck Greb

Other Decks in Technology

Transcript

  1. Why clean architecture? • All powerful Activities and Fragments •

    Separate business logic from Android framework • Improved testability
  2. MVC Supervising Controller • The View relays user input to

    the Controller • The Controller processes input and updates the Model • Changes in Model state are used to update the View
  3. MVP Passive View • View forwards user inputs and lifecycle

    events to the Presenter • Presenter interacts with Model to format data for display
  4. MVVM Presentation Model • ViewModel contains data field for every

    component in the View • Data binding and synchronization
  5. MVPC WTF • Modified version of MVP to accommodate Android

    framework • Cleanly separates business logic from UI and Activity lifecycle • Enables unit testing of non-Android components ◦ Presenter ◦ Model
  6. References Development of Further Patterns of Enterprise Application Architecture (DFPEAA)

    Martin Fowler Fragmented (Episode #11) - The Fowler Road to a Clean Architecture Donn Felker & Kaushik Gopal Android Architecture - A simple guide for MVC, MVP and MVVM on Android projects Thanos Karpouzis