Model–view–presenter

From Wiki @ Karl Jones dot com
Revision as of 04:47, 5 April 2016 by Karl Jones (Talk | contribs) (Description)

Jump to: navigation, search

Model–view–presenter (MVP) is a derivation of the Model–view–controller (MVC) architectural pattern, which is used mostly for building user interfaces.

Description

MVP improves the separation of concerns in presentation logic:

  • The model is an interface defining the data to be displayed or otherwise acted upon in the user interface.
  • The presenter acts upon the model and the view. It retrieves data from repositories (the model), and formats it for display in the view.
  • The view is a passive interface that displays data (the model) and routes user commands (events) to the presenter to act upon that data.

The presenter

In MVP the presenter assumes the functionality of the "middle-man".

All presentation logic is pushed to the presenter.

Unit testing

MVP facilitates automated unit testing.

See also

External links