Model-View-Controller or View Model Layering¶
Design pattern — instantiates Layered Abstraction
A presentation-tier pattern that splits an interactive component into three roles — a Model holding domain state, a View rendering it, and a Controller or ViewModel that translates between them and handles interaction — wired so the Model never depends on the View.
Model-View-Controller (MVC), and its View-Model variants, split one interactive component into three collaborating roles: a Model that holds the domain state and rules, a View that renders it on screen, and a Controller or ViewModel that mediates between them — translating model state into something displayable and turning user actions into model changes. Its defining move is a within-tier separation of concerns wired with a one-way dependency: the View depends on the Model (directly or through the ViewModel), but the Model knows nothing about the View. This is not a stack of vertical tiers; it is a horizontal division of the presentation concern into "what the data is," "how it looks," and "how interaction is handled," so each can change or be tested without dragging the others along. Swap the View for a different screen, and the Model is untouched, because it was never allowed to depend on the way it was shown.
Example¶
A mobile weather app shows the current conditions. The Model holds the fetched forecast — a temperature in Celsius, a condition code, a timestamp — as plain data with no notion of a screen. The ViewModel adapts that into display-ready form: it formats 22.4°C into the string "72°" for a user set to Fahrenheit, maps the condition code to "Partly cloudy" and an icon name, and exposes these as bindable properties. The View is nearly dumb: it binds those properties to labels and an image and draws them. When the user toggles the units switch, the View reports the tap to the ViewModel, which re-derives its formatted properties and notifies the View to re-render — and the Model's stored 22.4°C never changes. Because the formatting and interaction logic sit in the ViewModel rather than the View, that logic can be unit-tested with no screen at all, and the same Model could feed an entirely different View on a watch face.
How it works¶
- Assign the three roles. State and domain rules go to the Model; rendering goes to the View; translation and interaction handling go to the Controller/ViewModel. Each role has one reason to change.
- Adapt in the middle. The ViewModel/Controller reshapes raw model state into view-ready form (formatted strings, flags, bindable properties) and reshapes user actions into model operations.
- Wire dependencies one way. The View depends on the Model/ViewModel; the Model must not reference the View. Updates flow back via change-notification or binding, not by the Model reaching into the screen.
- Keep the View passive. The less logic the View holds, the more of the component is testable without a UI and swappable across screens.
Tuning parameters¶
- Logic placement — how much sits in the ViewModel versus the Model. A rich ViewModel keeps the Model pure and reusable but can itself bloat; a thin one risks leaking presentation logic into the View or domain logic into the Model.
- Binding style — one-way (Model → View) versus two-way (View ↔ Model). Two-way binding cuts boilerplate but makes data flow harder to trace; one-way is more verbose but keeps direction obvious.
- View passivity — how dumb the View is kept. A fully passive View maximizes testability but pushes everything into the ViewModel; a "smart" View is convenient but drags untestable logic onto the screen.
- ViewModel granularity — one ViewModel per screen or per component. Fine-grained ViewModels compose and test cleanly but multiply wiring; coarse ones are simpler but tend to accrete unrelated concerns.
When it helps, and when it misleads¶
Its strength is testability and substitutability of the presentation layer: with rendering, state, and interaction separated, the logic lives where a test can reach it without a screen, and the same Model can drive different Views. The pattern traces to Trygve Reenskaug's original MVC in Smalltalk-80 at Xerox PARC, conceived precisely to keep the user's mental model separate from its on-screen representation.[1]
Its failure mode is the role that swallows the others — the notorious "Massive View Controller," where the mediating piece accretes networking, formatting, business rules, and state until the separation is a fiction and nothing is testable. The mirror failure is logic leaking into the View, re-coupling look to behavior. The classic misuse is mistaking MVC for a whole-application architecture and letting the Model become the system's entire domain-and-persistence layer, when the pattern only governs the presentation tier. The guarding discipline is to keep the View passive, keep the Model ignorant of the UI, and hold the mediating role to translation and interaction rather than letting it become a catch-all.
How it implements the components¶
MVC/ViewModel layering fills the concern-separation slice of the archetype, scoped to the presentation tier:
responsibility_allocation_by_level— it assigns three distinct responsibilities — state, representation, interaction — to distinct roles, each with a single reason to change.translation_or_adapter_layer— the ViewModel/Controller adapts raw model state into view-ready form and user actions back into model operations.allowed_dependency_direction— the acyclic wiring in which the View depends on the Model but never the reverse, so rendering can change without disturbing state.
It does not implement a vertical layer_boundary between tiers or the encapsulated_implementation of persistence and infrastructure — that's [Layered Software Architecture]; MVC separates peer roles inside the presentation tier, whereas layered architecture stacks whole tiers with downward dependency across the system.
Related¶
- Instantiates: Layered Abstraction — MVC applies the archetype horizontally, separating one interactive component into level-appropriate roles.
- Sibling mechanisms: Curriculum Level Progression · Layered Software Architecture · Legal or Procedural Layering · Management Dashboard Layer · Middleware Layer · Operating System Abstraction · Protocol Stack
Editorial Notes¶
Form Classification¶
Form family: Structure, Architecture & Configuration
Rationale: Model-View-Controller or View Model Layering operates as a persistent arrangement of components, resources, interfaces, or technical topology because it a presentation-tier pattern that splits an interactive component into three roles — a Model holding domain state, a View rendering it, and a Controller or ViewModel that translates between them and handles interaction — wired so the Model never depends on the View.
Independent corroboration: The frozen evidence defines Model-View-Controller or View Model Layering as 'A presentation-tier pattern that splits an interactive component into three roles — a Model holding domain state, a View rendering it, and a Controller or ViewModel that translates between them and handles interaction — wired so the Model never depends on the View', so its operative form is Structure, Architecture & Configuration.
Review outcome: Independent reviewer agreement; high confidence.
Origin Attribution¶
Primary origin: Computer Science & Software Engineering
Origin pattern: Single lineage
Present-day reach: Specialized
Rationale: MVC and MVVM are named software architectural patterns developed for interactive application design.
Related originating lineages:
- Human-Computer Interaction — Interactive presentation requirements materially shaped the separation of state, rendering, and input mediation.
Review outcome: Independent reviewer agreement; high confidence.
References¶
[1] MVC was devised by Trygve Reenskaug while visiting Xerox PARC (1978–79) and first realized in Smalltalk-80. Its original aim was to separate the user's mental model of information from the way it is presented and manipulated — the seed of every later View-Model refinement that keeps domain state ignorant of its display. withdrawn registry ↩