Model–view–presenter
Model–view–presenter (MVP) is a derivation of the model–view–controller (MVC) architectural pattern, and is used mostly for building user interfaces. In MVP, the presenter assumes the functionality of the "middle-man". In MVP, all presentation logic is pushed to the presenter. Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.
Model–view–presenter (MVP) is a derivation of the model–view–controller (MVC) architectural pattern, and is used mostly for building user interfaces. In MVP, the presenter assumes the functionality of the "middle-man". In MVP, all presentation logic is pushed to the presenter. public class Presenter : IPresenter { public Presenter(IView view) { // ... } } public class View : IView { private IPresenter _presenter; public View() { _presenter = new Presenter(this); } } The degree of logic permitted in the view varies among different implementations. At one extreme, the view is entirely passive, forwarding all interaction operations to the presenter. In this formulation, when a user triggers an event method of the view, it does nothing but invoke a method of the presenter that has no parameters and no return value. The presenter then retrieves data from the view through methods defined by the view interface. Finally, the presenter operates on the model and updates the view with the results of the operation. Other versions of model–view–presenter allow some latitude with respect to which class handles a particular interaction, event, or command. This is often more suitable for web-based architectures, where the view, which executes on a client's browser, may be the best place to handle a particular interaction or command. From a layering point of view, the presenter class might be considered as belonging to the application layer in a multilayered architecture system, but it can also be seen as a presenter layer of its own between the application layer and the user interface layer. ==See also== Multitier architecture Model–view–controller Model–view–viewmodel Presenter first (software approach) ==References== ==External links== Model View Presenter Example from the GWT project. Model-View-Presenter implementation thoughts at StackExchange
Cite this
"Model–view–presenter". 1785139386. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1366321946 JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy