Difference between revisions of "Model–view–presenter"
From Wiki @ Karl Jones dot com
Karl Jones (Talk | contribs) (→Description) |
Karl Jones (Talk | contribs) (→See also) |
||
Line 21: | Line 21: | ||
== See also == | == See also == | ||
+ | * [[Architectural pattern]] | ||
* [[Computer science]] | * [[Computer science]] | ||
* [[Model–view–controller]] | * [[Model–view–controller]] |
Revision as of 04:47, 5 April 2016
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
- Model–view–presenter @ Wikipedia