| |||||||||
Model-View-Controller (MVC) is a software architecture that separates an application's data model, user interface, and control logic into three distinct components so that modifications to the view component can be made with minimal impact to the data model component. This is useful since models typically enjoy a fair degree of stability (owing to the stability of the domain being modeled), whereas user interface code usually undergoes frequent and sometimes dramatic change (owing to usability problems, the need to support growing classes of users, or simply the need to keep the application looking "fresh"). Separating the view from the model makes the model more robust, because the developer is less likely to "break" the model while reworking the view.
The pattern was first described 1979 by Trygve Reenskaug http://heim.ifi.uio.no/~trygver/themes/mvc/mvc-index.html It describes how the work was done in an early Smalltalk system at Xerox research labs.
Though MVC comes in different flavors, control flow generally works as follows:
In the design of web applications, MVC is also known as a "Model 2" architecture. Complex web applications continue to be more difficult to design than traditional applications, and MVC is being pushed as a potential solution to these difficulties.