marți, 13 octombrie 2009

[DesignPattern] MVP

Model-View-Presenter is a design pattern for separating the concerns of display and data.

  • Model - The observable data model that is the subject of the user-story.
  • Presenter - A construct that takes data from the model and exposes it to views.
  • View - Shows the interaction and display surface of the application.
-> acts as an external mediator


Model-View-Controller
Model-View- Presenter

ModelViewController.png ModelViewPresenter.png

Application domain logic
View
Application domain logic

Receives model elements from controller. Displays and interacts with element.
Controller
Receives data from presenter, notifies presenter of interactions.

Supervises view/model, performs actions in response to events/changes. Delegates events to model. Re-maps model outgoing events into state changes.

-> MVC: a view would receive an update and manipulate the model accordingly after being configured by its controller.


ModelViewPresenter_AbstractPresenterView.png
MVP - abstract

Niciun comentariu:

Trimiteți un comentariu