Model-view-controller
Encyclopedia
|
| Tutorials | Encyclopedia | Dictionary | Directory |
|
Model-view-controller
A simple diagram depicting the relationship between the Model, View, and Controller. Note: the solid lines indicate a direct association, and the dashed lines indicate an indirect association (e.g., observer pattern). Model-view-controller (MVC) is an architectural pattern used in software engineering. Successful use of the pattern isolates business logic from user interface considerations, resulting in an application where it is easier to modify either the visual appearance of the application or the underlying business rules without affecting the other. In MVC, the model represents the information (the data) of the application and the business rules used to manipulate the data; the view corresponds to elements of the user interface such as text, checkbox items, and so forth; and the controller manages details involving the communication to the model of user actions such as keystrokes and mouse movements.
HistoryThe pattern was first described in 1979[1] by Trygve Reenskaug, then working on Smalltalk at Xerox PARC. The original implementation is described in depth in the influential paper Applications Programming in Smalltalk-80: How to use Model-View-Controller.[2] After that numerous derivatives of the MVC pattern appeared. Probably one of the most known of them is the Model View Presenter pattern, which appeared in the early 90s and was designed to be an evolution of MVC. However Model-View-Controller still remains very widely used. Pattern descriptionModel-view-controller is both an architectural pattern and a design pattern, depending on where it is used. As an architectural patternIt is common to split an application into separate layers that run on different computers: presentation (UI), domain logic, and data access. In MVC the presentation layer is further separated into view and controller. MVC is often seen in web applications, where the view is the actual HTML page, and the controller is the code that gathers dynamic data and generates the content within the HTML. Finally, the model is represented by the actual content, usually stored in a database or in XML nodes, and the business rules that transform that content based on user actions. Though MVC comes in different flavors, control flow generally works as follows:
Some implementations such as the w3c XForms also use the concept of a dependency graph to automate the updating of views when data in the model changes. By decoupling models and views, MVC helps to reduce the complexity in architectural design, and to increase flexibility and reuse. As a design patternMVC encompasses more of the architecture of an application than is typical for a design pattern.
Selected frameworksGUI frameworksJava: Java SwingJava Swing is different from the other frameworks, in that it supports two MVC patterns: Model
Combined frameworksJava: Java Enterprise Edition (Java EE)Unlike the other frameworks, Java EE defines a pattern for model objects.
XForms
XForms stores the Model as XML in the browser.
The Views are XForms controls for screen elements and can be placed directly in a web page. The model and views are bound together using reference or binding statements. These binding statements are used by the XForms dependancy graph to ensure that the correct views are updated when data in the model changes.
All mouse events are processed by XForms controls and XML events are dispatched. Implementations of MVC as GUI frameworksSmalltalk's MVC implementation inspired many other GUI frameworks, such as the following:
Implementations of MVC as web-based frameworksIn the design of web applications, MVC is implemented by web template systems as "View for web" component. MVC is typically implemented as a "Model 2" architecture in Sun parlance. Model2 focuses on efficiently handling and dispatching full page form posts and reconstructing the full page via a front controller. Complex web applications continue to be more difficult to design than traditional applications because of this "full page" effect. More recently AJAX driven frameworks that focus on firing focused UI events at specific UI Components on the page are emerging. This is causing MVC to be revisited for web application development using traditional desktop programming techniques. .NET
ColdFusion
JavaMVC web application frameworks:
JavaScriptMVC web application frameworks:
ABAP ObjectsInformix 4GL
Perl
PHP
Python
RubySmalltalkXMLSee also
ReferencesExternal linksGeneral information regarding MVC
bg:Model-View-Controller ca:MVC cs:Model-view-controller de:Model View Controller es:Modelo Vista Controlador eo:Modelo-vidigilo-regilo fr:Modèle-Vue-Contrôleur ko:MVC ?? it:Model-View-Controller he:Model View Controller lv:MVC hu:Modell-nézet-vezérl? nl:Model-View-Controller-model ja:Model View Controller no:Model-view-controller pl:MVC pt:MVC ru:Model-view-controller fi:MVC-arkkitehtuuri sv:Model-View-Controller tr:Model-view-controller uk:??????-???-????????? zh:MVC Source: Wikipedia | The above article is available under the GNU FDL. | Edit this article
|
|
top
©2008-2009 TutorGig.com. All Rights Reserved. Privacy Statement