tags:

views:

72

answers:

3

Maybe I'm crazy, but I get MVC. It makes sense. MVVM seems like a way to make MVC harder, am I wrong (if so, why?)?

+2  A: 

Maybe this is helpful.

M_R_H
+2  A: 

You don't need MVVM - it just works well.

MVVM is just an alternative. You are free to use MVC. MVVM just takes advantage of some specific features in WPF and Silverlight (mainly the amazing DataBinding support, but also templating and commanding) in order to make your life, as a developer, simpler. MVVM is particularly good as decoupling the View from the code - even more so than MVC, as using the DataBinding allows a designer to change the View much more effectively without worrying about code changes than MVC.

MVVM also has the benefit of being very closely related to the fundamental design principles behind WPF and Silverlight. The basic idea of MVVM is very similar to the design of WPF and Silverlight at a fairly low level - For example, look at how templating works with custom controls, and compare it to the View/ViewModel separation, and there are a lot of correlations that can be drawn.

Reed Copsey
+2  A: 

I think that if you get MVC, then MVVM is really the same - with 1 additional part (the ViewModel). The reason that MVVM is more useful in my opinion has to do with the new DataBinding processes. The ViewModel provides useful abstraction and clarity about what is being databound, and how that binding is presented or converted. That's all it does in my mind.

The missing part from MVC is actually in the MVVM pattern, it's just the hidden part of MVVM in my opinion. If you look at most MVVM frameworks, most provide some sort of messaging or notification system, which really provides the missing Controller aspect of MVC.

Think of the ViewModel as the code-behind for your View, the View as the Designer of your View, the Model as the Model, and the Notification / Messaging system as the Controller, and we have a truely equivalent pattern.

This was a struggle for me to understand as well (I came from the MVC pattern as well, but now love the MVVM pattern).

Ryan from Denver