Skip to main content

Side by side

MVCvsMVVM

What is the difference between MVC and MVVM?

Updated 2 min read6 differences

In short

MVC splits an app into a model, a view and a controller that handles input, while MVVM puts a ViewModel between model and view and syncs them by data binding.

MVC

Model–View–Controller

MVC is an architectural pattern that splits an application into a Model for data and logic, a View for display, and a Controller that handles user input.

Read the page on MVC

MVVM

Model-View-ViewModel

MVVM (Model-View-ViewModel) is a UI pattern where a ViewModel holds a screen's state and actions and the View binds to it, so the UI follows state changes.

Read the page on MVVM

MVC and MVVM compared

AspectMVCMVVM
Middle layerControllerViewModel
How the view updatesThe controller picks and renders a viewData binding updates it automatically
OriginSmalltalk, 1979Microsoft WPF, 2005
Typical environmentServer-side web frameworksDesktop, mobile and reactive front ends
TestingControllers tested with request fakesViewModels tested without any UI
ExamplesRails, Django, Laravel, Spring MVCWPF, .NET MAUI, Android Jetpack, Vue

The difference, explained

Both patterns separate data and business logic, the model, from what the user sees, the view. In MVC, which dates back to Smalltalk in 1979, a controller receives user input, updates the model and selects a view to render. On the web, frameworks such as Rails, Django, Laravel and Spring MVC follow it: a request goes to a controller action, which loads data and renders a template.

MVVM, introduced at Microsoft in 2005 for WPF, replaces the controller with a ViewModel: an object that exposes the state and commands one screen needs, such as isLoading, items and refresh. The view binds to it declaratively, so when the ViewModel changes, the view updates by itself, and user input flows back through bindings.

That makes MVVM a natural fit for rich client apps with long-lived screens: desktop apps in WPF, mobile apps with Android's Jetpack ViewModel or SwiftUI, and reactive front-end frameworks. The ViewModel can be unit tested without any UI. MVC fits request-response server applications, where each request is handled and then forgotten.

A common misconception is that one pattern replaced the other. They solve similar separation problems in different environments, and many modern stacks mix ideas: a server can use MVC while its interactive front end uses components or ViewModels with data binding.

Which one should you use?

Choose MVC when…

  • You build a server-rendered web application.
  • Each request is handled independently and then finished.
  • Your framework, such as Rails or Laravel, is built on it.

Choose MVVM when…

  • You build a desktop or mobile app with long-lived screens.
  • Your UI framework supports data binding.
  • You want screen logic testable without the UI.

Readers ask

Is MVVM better than MVC?

Not in general. MVVM suits rich clients with data binding; MVC suits server-side request handling. The right choice depends on the platform.

Is React MVC or MVVM?

Neither strictly. React components combine view and state with one-way data flow, though hooks or stores that hold screen state play a role similar to a ViewModel.

What is MVP?

Model-View-Presenter, another variant where a presenter updates a passive view explicitly instead of through data binding. It was common in older Android and Windows Forms apps.

Read a random page
Open today's review
Switch to the dark theme
Read this page in Türkçe

More

Settings