Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF: MVP vs MVVM

Tags:

c#

mvp

mvvm

wpf

What is the difference between MVP VS MVVM? Why we are using MVP even though we have three layers: business, data access and presentation? Is there any specific reason to divide the Presentation layer into MVP?

like image 247
Rajesh Kumar G Avatar asked Dec 19 '10 06:12

Rajesh Kumar G


People also ask

Is MVP better than MVVM?

MVP architecture does not go well with the android applications or software and has activities as fragments in each stage of the life cycle. MVVM architecture goes well with android applications and updates the software with the new patches in the system. This helps the software to be up-to-date.

Which is better MVC or MVVM or MVP?

Compatibility — When testing the patterns based on their compatibility, MVVM was the best of the lot due to its data binding which had a positive impact. MVP fared better than MVC, which had serious restating issues.

Is WPF MVVM or MVC?

MVVM (Model-View-ViewModel)It is based on the Model-view-controller pattern (MVC), and is targeted at modern UI development platforms (WPF and Silverlight) in which there is a UX developer who has different requirements than a more "traditional" developer.


1 Answers

MVP and MVVM are both derivatives of MVC. MVC is a pattern that separates the user presentation and interaction from the internal representation.

This requires three layers, since tying the user interaction/presentation directly to the internal representation will cause both to bend to conform to each other. In your application, you described these layers as the Presentation, the Business layer, and the Data Access layer. With only those very loose descriptions, you could potentially be describing any of the MVC derivatives, or the original MVC pattern itself.

The key differences between each of the derivatives are the dependencies each layer takes on the other layers, and how tightly they are bound to each other. This article has some details on the differences, though of course it shouldn't be considered authoritative:

http://nirajrules.wordpress.com/2009/07/18/mvc-vs-mvp-vs-mvvm/

"... MVVM is attractive for platforms which support bi-directional binding with less effort. Also a minor tradeoff is ViewModel unlike Presenter can stand on its own (Presenter normally requires a View’s interface)."

like image 117
Merlyn Morgan-Graham Avatar answered Oct 15 '22 08:10

Merlyn Morgan-Graham