Skip to content
IT glossary
ArchitectureUpdated December 3, 2026

MVC

An application design pattern that separates what the app knows and does (Model), what it shows (View), and how it responds to user input (Controller).

Also known as: Model-View-Controller

What MVC separates

Model–View–Controller (MVC) gives application state, display, and input handling different jobs. Consider a room-booking app: changing the calendar layout shouldn't change whether a room can be booked, and adding a new booking screen shouldn't require copying the availability rules.

  • Model: Represents application state and the rules for changing it. For bookings, that includes rules such as preventing overlapping reservations for the same room. This role can span several domain objects and services.
  • View: Presents data to the user. A calendar view might format dates and highlight unavailable slots, but its highlights aren't what enforce availability.
  • Controller: Handles an incoming action, calls the appropriate application operation, and decides how to respond. On the web, that might mean rendering a template, returning an error response, or redirecting to another page.

Follow a booking request

In a server-rendered app, submitting the booking form sends POST /bookings. The router dispatches the request to a controller action. The controller reads the room ID and time range, checks that the fields can be parsed, and asks the booking service to make the reservation. The booking logic checks whether the room is available and saves the reservation if the rules allow it.

If the slot is already taken, the controller can render the form again with a message. If the reservation succeeds, it can redirect to GET /bookings/42. The handler for that request loads the reservation and passes its display data to a template, which generates the confirmation page. Redirecting after a successful form submission is a web convention, not a requirement of MVC.

Where the pattern varies

Frameworks such as Ruby on Rails and Spring MVC use MVC for handling web requests and producing responses. The classic desktop version can work differently: a view may observe an in-memory model and update when it changes, without waiting for another user action. In a typical server-rendered app, changing a record on the server doesn't automatically update HTML that's already in the browser. MVC describes responsibilities, not a single mandatory flow between the three parts.

Common mistakes and interview discussion

A database table or ORM record may be part of the model, but it isn't the whole model. Booking policy belongs with the application or domain logic that all entry points use, not in a template or in each individual controller. Parsing a date from a request is input handling; deciding whether the requested dates conflict with an existing booking is a business rule.

In an interview, be ready to trace a request and explain how you'd test the split. A model-level test can check that overlapping bookings are rejected without starting a web server. A controller test can check that the rejection produces the expected form response instead of a success redirect.