Saturday, January 8, 2011

Model View Presenter (MVP)

Model View Presenter (MVP) is a user interface design pattern. It's dedicated to isolate domain logic from the user interface and permits independent development, testing and maintenance of each.

A scenario in which you need to support multiple GUIs MVP is the best choice. It allows to write a presenter and reuse it in Windows and ASP.NET.

MVP is not a pattern that can be implemented quickly, because it can be a bit expensive to implement in relatively simple applications. On the other hand, it shines in enterprise applications, where you really need to reuse as much presentation logic as possible, across multiple platforms.

MVP is based on three actors: the view, the model and the presenter.




Model is a business layer with domain model, a table module or any sort of object model that suits you.

View is an interface that displays data and routes user actions to the presenter.

Presenter is a class which receives input from the view and passes commands down to model. When it gets results from the model it updates the view through the contracted view interface. Also presenter responsible for jumping to the new user interface.

MVP can be separated into Supervising Controller and Passive view.



No comments:

Post a Comment