MVP is the recommended pattern for Prism

Dec 9, 2008 at 3:42 PM

I noticed that you guys are using MVP pattern for all of your samples. Why? Is it the recommended pattern for Prism? Can we have more samples with MVVM pattern (with or without Datatemplate)?

Dec 10, 2008 at 5:31 PM

Hi Michael,


The team that developed the Composite Application Guidance for WPF and is developing Prism-v2 uses the MVP pattern mainly for testability purposes. The MVVM pattern (or Presentation Model) is also being used in the samples (without the automatic DataTemplate approach).

The bottom line is that the team is not recommending to pick only one approach and stick to it, but that you could use the approach that best suits your needs for the particular problem you are trying to solve, and the class library does not force you either way.

I believe that if you like MVVM, you should use it as your default UI pattern, but when solving a problem becomes too complex with this pattern, you shouldn’t hesitate to switch to a different one for that case, as the main reason for MVVM is simplicity (apart from the other benefits that MVP already brings).


If you think having more samples with MVVM pattern (or Presentation Model)  feature can be useful for you and the community feel free to suggest it in the Issue Tracker so people can vote for it and it might be taken into account for the future.


You might find useful the following posts related to this topic by Julian Dominguez:

·         Presentation Model with DataTemplates in CompositeWPF (Prism) Sample

·         First approach to Presentation Model with DataTemplates


Please let me know if this helps.


Damian Schenkelman