Model–view–controller (MVC) is a software design pattern[1] commonly used for developing user interfaces that divides the related program logic into three interconnected elements.
These elements are: Traditionally used for desktop graphical user interfaces (GUIs), this pattern became popular for designing web applications.
One of the seminal insights in the early development of graphical user interfaces, MVC became one of the first approaches to describe and implement software constructs in terms of their responsibilities.
[5] Trygve Reenskaug created MVC while working on Smalltalk-79 as a visiting scientist at the Xerox Palo Alto Research Center (PARC) in the late 1970s.
[6][7][8]: 330 He wanted a pattern that could be used to structure any program where users interact with a large, convoluted data set.
[9] In 1988, an article in The Journal of Object Technology (JOT) by two ex-PARC employees presented MVC as a general "programming paradigm and methodology" for Smalltalk-80 developers.
In 2003, Martin Fowler published Patterns of Enterprise Application Architecture, which presented MVC as a pattern where an "input controller" receives a request, sends the appropriate messages to a model object, takes a response from the model object, and passes the response to the appropriate view for display.
[15] With WebObjects, Rails, and Django, a model type typically represents a table in the application's database.
Within that method, the controller interacts with the request data and any relevant model objects and prepares a response using a view.
[39] As Alan Kay wrote in 2003, the original motivation behind the MVC was to allow creation of a graphical interface for any object.
"[6] In their 1991 guide Inside Smalltalk, Carleton University computer science professors Wilf LaLonde and John Pugh described the advantages of Smalltalk-80-style MVC as: Although originally developed for desktop computing, MVC has been widely adopted as a design for World Wide Web applications in major programming languages.
[42] Early MVC frameworks took a thin client approach that placed almost the entire model, view and controller logic on the server.
In this approach, the client sends hyperlink requests or form submissions to the controller and then receives a complete and updated web page (or other document) from the view; the model exists entirely on the server.
[42] Later frameworks have allowed the MVC components to execute partly on the client, using Ajax to synchronize data.