Catalog
concept#Architecture#Software Engineering#Platform

Model-View-Controller (MVC)

An architectural pattern that separates data model, presentation and control to improve maintainability and testability of UI-oriented systems.

MVC separates applications into Model, View and Controller to decouple data, presentation and user input.
Established
Medium

Classification

  • Medium
  • Technical
  • Architectural
  • Intermediate

Technical context

ORMs and persistence librariesFrontend templating engines or component librariesRouting and middleware layers

Principles & goals

Separation of concernsClear responsibilities for model, view and controllerCoherent interfaces and low coupling between layers
Build
Domain, Team

Use cases & scenarios

Compromises

  • Unclear boundaries lead to mixed logic
  • Controllers becoming a dumping ground for business logic
  • Lack of discipline in layer design increases maintenance costs
  • Keep controllers thin; business logic in the model
  • Define explicit contracts for view data
  • Use automated tests to secure the separation

I/O & resources

  • Domain model and business rules
  • UI designs or templates
  • Event and routing specifications
  • Separated layers (model/view/controller)
  • Improved test coverage and modularized components
  • Documented interfaces and contracts

Description

MVC separates applications into Model, View and Controller to decouple data, presentation and user input. It improves maintainability, testability and parallel development in web and desktop applications through clear responsibilities. At the same time MVC increases architectural complexity, requires discipline and can lead to controller bloat.

  • Improved maintainability through clearly defined layers
  • Better testability of business logic separate from the UI
  • Facilitates parallel development of UI and backend

  • Increased architectural and coordination effort
  • Not optimal for highly dynamic component-based UIs
  • Can lead to oversized controllers (controller bloat)

  • Proportion of unit-tested business logic

    Measures percentage of domain logic covered by unit tests.

  • Average controller size

    Metric to detect controller bloat by LOC or number of methods.

  • Time-to-change for UI adjustments

    Time from change request to production delivery of a UI change.

Ruby on Rails

Rails implements MVC as a central architecture principle with clear conventions for models, views and controllers.

ASP.NET MVC

Microsoft's framework provides a structured MVC implementation for web applications with routing and controller lifecycle.

Desktop applications (e.g., Java Swing variants)

MVC concepts appear in many desktop UI frameworks to separate presentation and logic.

1

Analyze existing code paths and identify responsibilities

2

Extract the domain model from UI logic

3

Implement views separate from controller logic

4

Add tests for model and controller layers

⚠️ Technical debt & bottlenecks

  • Historically grown controllers with mixed logic
  • Untested model functions in the codebase
  • Missing interface definitions between views and controllers
Controller bloatData couplingRendering performance
  • Moving complex validations into controllers instead of the model
  • Using MVC as boilerplate without real layer separation
  • Excessive use of global state between layers
  • Insufficient tests for controller interactions
  • Missing documentation of contracts between layers
  • Inconsistent naming and responsibility assignment
Software architecture and layer designExperience with test-driven developmentKnowledge of the chosen framework (e.g., Rails, ASP.NET)
Maintainability of UI logicTestability and automationNeed for parallel development
  • Requires clear interface definitions
  • Not ideal for purely component-based frameworks without central controllers
  • Onboarding time for developers to apply correct layer separation