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

MVP Pattern for Android

MVP Pattern for Android

Model-View-Presenter Pattern used in Android application development makes developing easier.

Raka Westu Mogandhi

July 31, 2015
Tweet

More Decks by Raka Westu Mogandhi

Other Decks in Programming

Transcript

  1. MVP vs MVC • MVP Pattern – View is more

    loosely coupled to the model. The presenter is responsible for binding the model to the view. – Easier to unit test because interaction with the view is through an interface – Usually view to presenter map one to one. Complex views may have multi presenters. • MVC Pattern – Controller are based on behaviors and can be shared across views – Can be responsible for determining which view to display
  2. Why use MVP? • Makes view separated from data source

    → code is easier to scale and maintain. • Makes testing approach easier.
  3. Future Implementation • RxJava/RxAndroid usage to manage data flow. (Example:

    https://github.com/zsiegel/rx-mvp-android) • Separate model layer using UseCase/Interactor-Repository Pattern – Repository → Get data from data source (network, database, etc.). – UseCase/Interactor → Get data that will be used on presenter from repository. •