I can't see the difference between MVC and MVVM clearly. I feel the Command in a ViewModel is just like the Action method in a Controller. And both the Controller and ViewModel will notify the View to refresh itself after modifying the state of the Model through Data Binding. What is the main difference between the two patterns?

1 Answer 1


The controller and the ViewModel differ in various ways.

In MVC the Controller knows the view, it can change the View. It also knows the Model and can call it. In MVVM a ViewModel is an abstract representation of the View and does not know the concrete UI, it wraps the Model in a way so that it can be displayed as desired.

In classical MVC, a controller is just a strategy of the View to interact with the Model. In fact, sometimes a Controller isn't even necessary. In MVVM you don't need it, as you can have different ViewModels for the same View if you need different behaviours. In MVC you could have for example a ReadOnlyController or an AdminController to communicate with the Model. In MVVM you could just have two ViewModels and you choose the one you need for the View.

But they do have some similarities. In both patterns, the View is an observer. In classical MVC, the view is an observer of the model, in MVVM it's an observer of the ViewModel.

Both patterns are meant to provide a separation of concerns. MVVM primarily aims to provide an abstraction of the View, completely independent of the UI technology in use. MVC does not go that far. It's primary focus is on separation of concerns, so that you don't put business logic (the Model) into the view.

You might also find this answer of mine to a similar question helpful.

At last, I should say that both patterns belong to the same family. MVP, of which MVVM is a descendant is a sibling of MVC. If you want to know more follow this link to Martin Fowler's website, he explains everyting in detail.

  • don't you think these model-view architectures are best understood by the people implementing them. I believe it's matter of choice for the developer. One choose MVC or MVVM depending whether he wants a total abstraction about the view with a little over-head(in case of MVVM). Commented Aug 31, 2011 at 8:05
  • @Pankaj Upadhyay: Which one you should use depends on your requirements and choice of technology and also the idiosyncracies of your platform.
    – Falcon
    Commented Aug 31, 2011 at 8:15
  • I believe that MVC architecture is good enough for anything, but that might be because i haven't faced a problem that particularly required MVVM. IMO, you certainly need to have some control over the view because making it absolutely loose will enhance more errors in future upgrades Commented Aug 31, 2011 at 8:22
  • 1
    @Pankaj Upadhyay: If you want to use the same logic for various UI technologies then MVP is superior. I don't think that you necessarily need some control over the view. It can be totally independent and you can test the ViewModels just as well - if not better. The better separation also benefits designers as the work on the project can be partitioned better.
    – Falcon
    Commented Aug 31, 2011 at 8:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.