Model–view–presenter

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

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

In software development, Model–view–presenter (MVP) is an 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.

Derivation of Model–view–controller (MVC)

MVP is a derivation of the Model–view–controller (MVC) pattern.

See also

External links