mvp-vs-mvvm-vs-presentation-model

blog-post-poro-presenters


Iordanis Giannakakis : Android Team Lead at Shazam

MVP: model view presenter

From: http://www.slideshare.net/mobile/igiannakakis/how-to-build-rock-solid-apps-and-keep-100m-users-happy

He describes this pattern as MVP, but the P (presenter) has state, which I thought was the reason for calling something a view model.


The guy who created m-v-vm calls, John Gossman, calls them ViewModels (no spaces) and talks about their testing advantages here: http://blogs.msdn.com/b/johngossman/archive/2006/03/04/543695.aspx


They are also called "view objects" or "view models" in blog-post-7-ways-to-decompose-fat-activerecord-models


They are also called view models here: http://nicksda.apotomo.de/2014/08/rails-misapprehensions-replace-helpers-with-view-models


They are also called view models here: http://www.teehanlax.com/blog/model-view-viewmodel-for-ios/


podcast-bike-shed-episode-1#facade

They call the presenter in the controller a "facade". They say it's basically a presenter. They also say it's like a really really dumb view model. So, they seem to say that a view model is a smarter presenter in some way.

 

The Draper Gem calls them "view models" in the project's header, but then goes on to say in the documentation:

"You might have heard this sort of decorator called a "presenter", an "exhibit", a "view model", or even just a "view" (in that nomenclature, what Rails calls "views" are actually "templates"). Whatever you call it, it's a great way to replace procedural helpers like the one above with "real" object-oriented programming."


blog-post-presentation-model


The view model described in the second paragraph of the Wikipedia Article on MVVM sounds most close to what we're talking about:

"MVVM facilitates a clear separation of the development of the graphical user interface (either as markup language or GUI code) from the development of the business logic or back end logic known as the model (also known as the data model to distinguish it from the view model). The view model of MVVM is a value converter[6] meaning that the view model is responsible for exposing the data objects from the model in such a way that those objects are easily managed and consumed. In this respect, the view model is more model than view, and handles most if not all of the view's display logic (though the demarcation between what functions are handled by which layer is a subject of ongoing discussion[6] and exploration). The view model may also implement a mediator pattern organizing access to the backend logic around the set of use cases supported by the view."

It event calls out AngularJS as using a similar presentation model design patterns.


Introduction to MVVM in the Objective-C Magazine and Hacker News comments


blog-post-presenters-do-not-need-lifecycle-events

Referring Pages

direct-code-transformation-as-implementation keep-some-ideas-that-you-are-always-working-on

People

person-martin-fowler person-iordanis-giannakakis person-bryan-helmkamp person-john-gossman