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 one component can be made with minimal impact to the others.
MVC is often thought of as a software design pattern. However, MVC encompasses more of the architecture of an application than is typical for a design pattern. Hence the term architectural pattern may be useful (Buschmann, et al 1996), or perhaps an aggregate design pattern.
It's common to think of an application as having three main layers: presentation (UI), domain, and data access. In MVC, the presentation layer is split into controller and view. The most important separation is between presentation and domain; the View/Controller split is less so.
Though MVC comes in different flavors, control flow generally works as follows:
Through decoupling of the model, view and controller components, each unit can change irrespective of the implementation of the other. For instance, a typical implementation of a web application will rely on the view component to layout HTML in response to a user's request. If, however, an XML response is required, only the view component need change (to an XML formatting component) while the model and controller remain the same.
A simple diagram depicting the relationship between the Model, View, and Controller is provided below. Note: the solid lines indicate a direct association, and the dashed line indicate an indirect association (i.e. Observer pattern).
Smalltalk's MVC implementation inspired many other GUI frameworks such as:
More recently there have been attempts to apply MVC architectures for web-based interfaces. In the design of web applications, MVC is also known as a "Model 2" architecture in Sun parlance. 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.
Specific aspects of MVC or alternatives to MVC
MVC frameworks in PHP
Software design patterns | Software architecture | Programming paradigms
Model-view-controller | Model View Controller | Modelo Vista Controlador | MVC | Modèle-Vue-Contrôleur | Model-View-Controller | ארכיטקטורת MVC | Model-View-Controller-model | Model View Controller | MVC | MVC | Model View Controller | MVC-arkkitehtuuri | Model-View-Controller | MVC
This article is licensed under the GNU Free Documentation License.
It uses material from the
"Model-view-controller".
Home Page • arts • business • computers • games • health • hospitals • home • kids & teens • news • physicians • recreation• reference • regional • science • shopping • society • sports • world