MVC / MVP / MVVM What the Heck?

16,035

Solution 1

Microsoft's Application Architecture Guide describes MVC and MVP, and explores the differences between the two.

http://www.codeplex.com/AppArch

This MSDN article describes MVVM and it's evolution.

http://msdn.microsoft.com/en-us/magazine/dd419663.aspx

Solution 2

It can be hard to grok the differences between patterns by looking at a particular pattern implemented in a particular framework. This msdn article WPF MVVM makes reference to Martin Fowlers original articles which explain a pattern as a general approach:

Back in 2004, Martin Fowler published an article about a pattern named Presentation Model (PM) [...] consider MVVM to be a specialization of the more general PM pattern, tailor-made for the WPF and Silverlight platforms.

So to understand different patterns it is useful to look at Martin Fowler's descriptions of different approaches. His Passive View pattern is the MVP approach. His Supervising Controller pattern is the MVC approach. His Presentation Model pattern is the MVVM approach. This older article takes about the evolution of such patterns.

It may also help to look at implementations in different languages. The article Implementing event-driven GUI patterns using the ZK Java AJAX framework contrasts the three of Martin Fowler patterns mentioned above in a modern Java framework. Even though its a different language and a different framework from WPF it may help to see the pattern rather than the implementation of the pattern to see it done in a different language.

Share:
16,035
Steve
Author by

Steve

I'm a .Net Developer with a background in WPF, WinForms, WebForms, SQL Server, DB2, Oracle and Sybase IQ. Currently building LOB WPF desktop applications and interested in ORMs, Unit Testing, CI and best practices.

Updated on June 15, 2022

Comments

  • Steve
    Steve almost 2 years

    I recently worked on a .Net WPF project to build a retail point of sale system where I used the MVP pattern for the first time. It took me a little while to wrap my head around the change of approach but once I did that I thought that the concept rocked!

    My question is this: what is the distinction between MVC, MVP and MVVM? If there is a clear distinction, are there guidelines as to when you should use one pattern over another?

    If anyone can offer guidance on this, or point to article that explains the differences I'd very much appreciate it.