Skip to content

Instantly share code, notes, and snippets.

@rafszul
Last active August 29, 2015 14:19
Show Gist options
  • Save rafszul/c423ff5a50d17087020f to your computer and use it in GitHub Desktop.
Save rafszul/c423ff5a50d17087020f to your computer and use it in GitHub Desktop.
What is the difference between MVC and MVVM? src http://stackoverflow.com/a/14855482/1667139

And this rich desktop way is probably where the second acronym originated, MVVM. Don't be fooled by the letters, by the omission of the C. Controllers are still there. They need to be. Nothing gets removed. We just add one thing: statefulness, data cached on the client (and along with it intelligence to handle that data). That data, essentially a cache on the client, now gets called »ViewModel«. It's what allows rich interactivity. And that's it.

MVC = model, controller, view = essentially one-way communication = poor interactivity
MVVM = model, controller, cache, view = two-way communication = rich interactivity

We can see that with Flash, Silverlight, and - most importantly - Javascript, the web has embraced MVVM. Browsers can no longer be legitimately called thin clients. Look at their programmability. Look at their memory consumption. Look at all the Javascript interactivity on modern web pages.

Personally, I find this theory and acronym business easier to understand by looking at what it's referring to in concrete reality. Abstract concepts are useful, especially when demonstrated on concrete matter, so understanding may come full circle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment