mvc vs mvp

n MVC, the model stores the data, the view is a representation of that data, and the controller allows the user to change the data. When the data is changed, all views are notified of the change and they can update themselves as necessary (think EventDispatcher).

MVP is a derivative of MVC, mostly aimed at addressing the “Application Model” portion of MVC and focusing around the observer implementation in the MVC triad. Instead of a Controller, we now have a Presenter, but the basic idea remains the same – the model stores the data, the view is a representation of that data (not necessarily graphical), and the presenter coordinates the application

 

 This search application is extremely basic and used for purely illustrative purposes only.

It consists of a single Use Case scenario; Search, which executes as follows:

  1. 1.       User enters a search criteria (e.g. “test”)
  2. 2.       The User initiates a search in the UI (e.g. Button click)
  3. 3.       The View component handles the search event, and invokes the ‘Search()’ function on the Presenter
  4. 4.       The Presenter extracts the search criteria string from the View’s ‘SearchCriteria’ property
  5. 5.       The Presenter invokes the Business operation ‘Business Search’ on the Model, passing the search criteria as an argument
  6. 6.       The Model returns all matching results for the given search criteria
  7. 7.       The Presenter sets these results in the View component’s ‘Results’ property
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s