Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Model–view–controller
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==History== 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 [[Single responsibility principle|responsibilities]].<ref>[http://c2.com/cgi/wiki?ModelViewControllerHistory Model–View–Controller History]. C2.com (2012-05-11). Retrieved on 2013-12-09.</ref> [[Trygve Reenskaug]] created MVC while working on [[Smalltalk]]-79 as a visiting scientist at the Xerox [[PARC (company)|Palo Alto Research Center]] (PARC) in the late 1970s.<ref name="page_trygver">[http://heim.ifi.uio.no/~trygver/themes/mvc/mvc-index.html Notes and Historical documents] from Trygve Reenskaug, inventor of MVC.</ref><ref name="notes1">"A note on DynaBook requirements", Trygve Reenskaug, 22 March 1979, [https://wayback.archive-it.org/10370/20180425072145/http://folk.uio.no/trygver/1979/sysreq/SysReq.pdf SysReq.pdf].</ref><ref name="FowlerPoEAA">{{cite book |last=Fowler |first=Martin |author-link=Martin Fowler (software engineer) |date=2003 |title=Patterns of Enterprise Application Architecture |publisher=Pearson Education, Inc. |isbn=0-321-12742-0}}</ref>{{rp|name=FowlerPoEAA |p=330 |q=''Model View Controller''...started as a framework developed by Trygve Reenskaug for the Smalltalk platform in the late 1970s.}} He wanted a pattern that could be used to structure any program where users interact with a large, convoluted [[data set]]. His design initially had four parts: [[Model]], view, thing, and editor. After discussing it with the other Smalltalk [[Software development|developers]], he and the rest of the group settled on model, view, and controller instead.<ref name="page_trygver" /> In their final design, a model represents some part of the program purely and intuitively. A view is a visual representation of a model, retrieving data from the model to display to the user and passing requests back and forth between the user and the model. A controller is an organizational part of the user interface that lays out and coordinates multiple Views on the screen, and which receives user input and sends the appropriate messages to its underlying Views. This design also includes an Editor as a specialized kind of controller used to modify a particular view, and which is created through that view.<ref name="page_trygver" /> Smalltalk-80 supports a version of MVC that evolved from this one.<ref name="page_trygver" /> It provides abstract <code>view</code> and <code>controller</code> [[Class (computer programming)|classes]] as well as various concrete subclasses of each that represent different generic [[Software widget|widgets]]. In this scheme, a <code>View</code> represents some way of displaying information to the user, and a <code>controller</code> represents some way for the user to interact with a <code>view</code>. A <code>view</code> is also coupled to a model object, but the structure of that object is left up to the application [[programmer]]. The Smalltalk-80 environment also includes an "MVC Inspector", a development tool for viewing the structure of a given model, view, and controller side-by-side.<ref name="smalltalk_redbook">{{cite book |last=Goldberg |first=Adele |author-link=Adele Goldberg (computer scientist) |title=Smalltalk-80: The Interactive Programming Environment |date=1984 |publisher=Addison-Wesley |isbn=0-201-11372-4}}</ref> 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. However, their scheme differed from both Reenskaug et al.'s and that presented by the Smalltalk-80 reference books. They defined a view as covering any graphical concern, with a controller being a more abstract, generally invisible object that receives user input and interacts with one or many views and only one model.<ref name="art1">{{cite journal|first1= Glenn E.|last1= Krasner|first2= Stephen T.|last2= Pope|title= A cookbook for using the model–view controller user interface paradigm in Smalltalk-80|url= http://dl.acm.org/citation.cfm?id=50757.50759|publisher= SIGS Publications|date= Aug–Sep 1988|journal= [[The Journal of Object Technology]]|volume= 1|issue= 3|pages= 26–49}} Also published as "[https://web.archive.org/web/20100921030808/http://www.itu.dk/courses/VOP/E2005/VOP2005E/8_mvc_krasner_and_pope.pdf A Description of the Model–View–Controller User Interface Paradigm in the Smalltalk-80 System]" (Report), ParcPlace Systems; Retrieved 2012-06-05.</ref> The MVC pattern subsequently evolved,<ref name="Fowler">[http://martinfowler.com/eaaDev/uiArchs.html The evolution of MVC and other UI architectures] from Martin Fowler.</ref> giving rise to variants such as [[hierarchical model–view–controller]] (HMVC), [[model–view–adapter]] (MVA), [[model–view–presenter]] (MVP), [[model–view–viewmodel]] (MVVM), and others that adapted MVC to different contexts. The use of the MVC pattern in [[web application]]s grew after the introduction of [[NeXT]]'s [[WebObjects]] in 1996, which was originally written in [[Objective-C]] (that borrowed heavily from Smalltalk) and helped enforce MVC principles. Later, the MVC pattern became popular with Java developers when WebObjects was ported to [[Java (programming language)|Java]]. Later frameworks for Java, such as [[Spring Framework|Spring]] (released in October 2002), continued the strong bond between Java and MVC. In 2003, [[Martin Fowler (software engineer)|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.{{r| name="FowlerPoEAA" |p=56 |q=A request comes in to an input controller...It then forwards the business logic to an appropriate model object. The model object talks to the data source...it [then] returns control to the input controller, which...decides which view is needed to display the response. It then passes control, together with the response data, to the view.}} This is close to the approach taken by the [[Ruby on Rails]] web application framework (August 2004), which has the client send requests to the server via an in-[[Web browser|browser]] view, these requests are handled by a controller on the server, and the controller communicates with the appropriate model objects.<ref>{{cite web |url=https://guides.rubyonrails.org/ |title=Ruby on Rails Guides |access-date=March 19, 2022}}</ref> The [[Django (web framework)|Django]] framework (July 2005, for [[Python (programming language)|Python]]) put forward a similar "model-template-view" (MTV) take on the pattern, in which a view retrieves data from models and passes it to templates for display.<ref>{{cite web |url=https://docs.djangoproject.com/en/4.0/faq/general/#django-appears-to-be-a-mvc-framework-but-you-call-the-controller-the-view-and-the-view-the-template-how-come-you-don-t-use-the-standard-names |title=Django FAQ: Django appears to be a MVC framework, but you call the Controller the "view", and the View the "template". How come you don't use the standard names? |access-date=March 19, 2022}}</ref> Both Rails and Django debuted with a strong emphasis on rapid deployment, which increased MVC's popularity outside the traditional enterprise environment in which it has long been popular.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)