What is a model presenter?

Can someone explain as simply as possible what a model representation view template is? What is the difference with Model View Controller? Which is better or for what purpose?

+47
design-patterns model-view-controller mvp
Aug 23 '09 at 3:32
source share
4 answers

Martin Fowler has a page on user interface design templates in which he defines and then talks about MVC, MVP, and other templates.

http://martinfowler.com/eaaDev/uiArchs.html

To summarize the differences, controllers in MVC have more control over the user interface and handle events, and the leader in MVP is more passive and simply presents information through the user interface.

In general, there is not much difference, and often the line between them is blurred.

+28
Aug 23 '09 at 3:44
source share

Model View Presenter and Model View Controller are both trying to solve the same problem-sharing problem.

The main difference that you find is that Model View Controller (MVC) is often implemented with some connection between the view and some model of some type - thus, this view is specifically designed to provide visualization of this object (model).

In the Presenter Model View template, you usually find that Presenter takes care of working with the model and decides what information is needed from it to form some kind of visualization.

In this diagram, arrows represent dependencies:

MVC and MVP dependencies

As a rule, you hear that the discussion of patterns arises when discussing the structure of ASP.NET MVC and there is information about the MVP pattern and its implementation in ASP.NET WebForms. In my experience, it is believed that WebForms is itself an MVP template framework - this is not true. However, WebForms simplifies the implementation of the MVP template - the best resource for this is to study the Factory Web Client software from the Templates and Practices team:

CodePlex Website: http://www.codeplex.com/websf

Great screencast covering the topic: http://www.pnpguidance.net/Screencast/MVPBundleScreencastWCSFModelViewPresenterDesignPattern.aspx

+54
Aug 23 '09 at 4:13
source share

Fowler divides MVP into 2 patterns: presenter supervision and passive presentation.
Aviad Ezra has a good article on this topic http://aviadezra.blogspot.com/2008/10/model-view-presenter-design-pattern.html .
I think that MVP is better for the desktop, and MVC is better for the web application, because on the desktop the model has the ability to raise an event

+4
Nov 07 '09 at 0:17
source share

The Smalltalk dolphin used to have an MVC implementation, but then they migrated to MVP.

Here's a white paper that describes what they did and why.

The IBM Taligent system also used MVP - they describe what and why here .

+3
Nov 06 '09 at 23:52
source share



All Articles