Model View Presenter

The Model View Presenter (MVP) pattern is very similar to MVC. It is a fairly well known pattern in the Microsoft world and is generally used to structure WPF and Silverlight applications. It can be used in pure JavaScript as well. The key difference comes down to how the different parts of the system interact and where their responsibility ends.

The first difference is that with the presenter there is a one-to-one mapping between the presenter and the view. This means that the logic that existed in the controller in the MVC pattern that selected the correct view to render, doesn't exist. Or rather, it exists at a higher level outside the concern of the pattern. The selection of the correct presenter may be handled by a routing ...

Get Mastering JavaScript Design Patterns now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.