WELCOME TO SILVERLIGHT

DARE TO BE DIFFERENT

Monday, May 4, 2009

What is Model View Presenter?

Model View Presenter

MVP pattern is one of the major patterns used for extracting business logic outside of UI elements and by that, enabling unit testing the UI without the need for using specific UI based testing tool.
As we can see from this diagram:
  • View contains the Presenter instance (view "knows" presenter) .
  • Presenter is the only class knowing how to reach to model and retrieve the data needed for performing business logic.
  • Presenter talks to the View through the view.
  • View doesn't know anything about the Model.
  • View responsibility is to show the data provided by presenter.
  • Purpose of the presenter is to reach to model, retrieve the needed data, performs required processing and returns the UI prepared data to the view.

No comments:

Post a Comment