MVVM - Controller - Presenter - ViewModel mix-up

Topics: Prism v2 - WPF 3.5
Jul 19, 2009 at 8:32 AM

In the QuickStarts and Stocktrader Reference Implementation there is a total mix up of different approaches. Sometimes there is a Presenter, sometimes there is only a controller, sometimes the controller provides and handles commands, other times the Presentation Model (which seems to be the ViewModel) does this work... I try to figure out what is the "way to do it!" and came to the following conclusion.

I would do it the following way:

  • View: Showing UI elements and bound data, accepts input gestures from outside, Reacting to UI elements events that cannot bind to Commands (launches commands in code behind event handlers)
  • ViewModel: Holds reference to model, Provides view data and change notification, provides commands, fire events for Presenter
  • Model: The business objects (mostly pure data containers)
  • Presenter: Here sits the business logic, reacts to Events from ViewModel, can create child views and presenters, Uses services to manage models (loading, saving)

So I would rather use the term MVP+ pattern, which means MVP with Commanding and Binding enabled.

Does anybody agree/disagree with this? Any comment is appreciated.

Best regards, Yannik

Jul 19, 2009 at 8:53 AM


I prefer the M-V-VM approach as described in this link: 

Regarding your approach outlined above, if we use the VM pattern, the View's code-behind would not have any event handlers; Commands can be attached to any control - even those that do not expose the 'Command' property - by adding Attached Properties.


Aug 31, 2009 at 12:30 PM

Hey Yannik,

Your thought sounds interesting to me. Could you pelase explain your design with some code example.






Aug 31, 2009 at 12:48 PM
Edited Sep 2, 2009 at 12:22 PM

MVVM has limitations which were exposed by both Martin Fowler (back in 2006 when it was called the Presentation Model, aka Application Model) and John Gossman (father of MVVM) - I blog on the topic HERE.   

If you are interested I have a codeplex project at which demonstrates the MVP and Presentation Model being used by PRISM to support Silverlight 3 (SL3),  SL3 w/RIA, WinForms and WPF - using a single codebase.

This project utilizes Patterns and Practices learned from the Smart Client Software Factory (these folks will be comfortable with the infrastructure), Web Client Software factory and samples taken from the early drops - specifically the TopDown Composition example from PRISM V2 Drop 7.