android-samples-mvp

Model-view-presenter (MVP) introduction


The introduction of mvp on the wiki is
  • Model  defines the data model that needs to be displayed in the user interface, a model contains related business logic
  • View  View should not handle business logic, switch views according to the presenter's command, listen to the user's event and pass it to the presenter.
  • Presenter  handles view events, is responsible for business logic, retrieves Model to get data, and handles View accordingly

Class Diagram Reference

Class Diagram

demo

https://github.com/googlesamples/android-architecture/tree/todo-mvp

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324789096&siteId=291194637
MVP