Quick Take on MVC x MVP x MVVM

I wish I am more diligent to create visual diagram for this post. But, here’s the take.

MVP

A variation of MVC pattern and mostly implemented in ASP.NET web form to achieve separation of concern such in MVC. In MVP, Presentation knows about the View through View’s contract (interface). Suggested reading: Jean-Paul Boodhoo’s August 2006 Design Patterns column.

MVC

Very similar to MVP, but in MVC, the controller (Presenter in MVP) doesn’t refer back to View. A controller can be used by multiple Views. This is achieved with Action (a method in controller) in ASP.NET MVC. Suggested reading: Niraj Bhatt’s MVC vs MVP vs MVVM.

MVVM

Similar to Martin Fowler’s Presentation Model pattern, MVVM pattern is introduced by John Gossman in 2005, tailor-made to harness the core feature and power of WPF (and Silverlight) platform. In MVVM, as in Presentation Model pattern, the ViewModel keeps up to date with the View, the two always sync with each other. Suggested reading: Josh Smith’s The Evolution of Model-View-ViewModel.

MVVM in JavaScript

In recent years, MVVM has also been implemented in JavaScript as a framework, such in KnockoutJS or Kendo MVVM. Suggested reading: Addy Osmani’s Understanding MVVM – Guide for JavaScript Developers

ASP.NET MVC’s View Models

In ASP.NET MVC, there is something called View Models. This is not to be confused with MVVM pattern. View Models is objects defined in class that each View in MVC interact with. The difference between View Models and Model in MVC is that Model refers to the objects that the whole application interact. Suggested reading: Stephen Walther’s ASP.NET MVC Create View Models

Other Sources

More links for more readings about the three:

MVVM vs MVP vs MVC: The concise explanation
MVVM vs MVP vs MVC: The differences explained

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s