Model-View-Controller

noun

say it: “MOD-ul VYOO kun-TROH-ler” /ˈmɑdəl vju kənˈtroʊlɚ/

A pattern that splits the code behind a page into a model (the data and rules), views (how it's shown) and a controller (what a request does).

What is Model-View-Controller (MVC)?

Model-View-Controller, or MVC, splits the code behind a page three ways. The model holds the data and the rules (a book on loan shows its due date). A view only draws what it's handed (a web page, or plain data for a phone app). A controller takes the request, asks the model and picks the view. A new screen is then a new view, and a rule lives in one place.

In a sentence

  • “With Model-View-Controller, the phone app's list was one new view, and the due-date rule stayed in one place.”

Level: Journeyman · More OOP terms at this level

Updated