Rendering and architecture · Pattern

MVC and MVVM

Two classic ways to organise an app's code by separating the data and rules (the model) from what the user sees (the view) and the glue between them.

Architecture · updated

How it works

In MVC, a controller receives a request or input, works with the model (data and business rules) and picks a view to render. Web frameworks such as Laravel, Rails, Django (which calls it MTV), ASP.NET MVC and Spring MVC are built around it. In MVVM, a view model holds a screen's state and actions, and the view binds to it and updates automatically when it changes.

MVVM came from Microsoft's desktop frameworks and is now the usual pattern for Android apps built with Jetpack Compose and ViewModel, and common in SwiftUI apps. Component frameworks such as React blur the lines, but the core idea, keeping business logic out of the interface code, still makes an app easier to test and change.

More in Rendering and architecture

Architecture

All 16 Rendering and architecture terms

Crafted in the dark. Shipped to the world.

Tell us what you are building. You get a private project space with a proposal and a line-by-line quote within a day.