Promptles
Architecture

MVC (Model-View-Controller)

beginner

Definition

A classic recipe for organizing an app into three pieces. The Model is the data and the rules about it. The View is what the user sees on the screen. The Controller is the middleman that takes user actions and updates the data or the view in response.

In the wild

On a simple to-do list site: the Model is the list of tasks (and the rule that a task can be done or not done). The View is the page showing the tasks. The Controller is what runs when you click 'mark as done'. It updates the model, which then refreshes the view.

More from Architecture