Index: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Home > Model-view-controller
Articles to be merged- This article should include material from
Model view controller triadModel-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:
- user interacts with the user interface in some way (e.g., user presses a button)
- controller receives notification of the user action from the user interface objects
- controller accesses the model, possibly updating it in a way appropriate to the user's action (e.g., controller updates user's shopping cart)
- controller delegates to the view for presentation
- view uses the model to generate an appropriate user interface (e.g., view produces a screen listing the shopping cart contents)
- user interface waits for further user interactionGenerally, an interaction is a kind of action which occurs as two or more objects have an effect upon one another. The word is sometimes used synonymously with " transaction"; in some cases, a difference between the two should be distinguished. Examples is, which begin the cycle anew.
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.
1 Implementations
- Jakarta StrutsJakarta Struts is an open-source framework for developing J2EE web applications. It uses and extends the Java Servlet API to encourage developers to adopt an MVC architecture. It was originally created by Craig McClanahan and donated to the Apache Foundat
- MVC-Frameworks written in PHP (Wiki)
- FuseboxFusebox is a popular web development framework for ColdFusion and other web development languages. Fusebox shows non-programmers (of whom there are many who develop in ColdFusion) a standard, structured way of getting things done in an easy and methodical
- Maypole
- The OPENSTEP and NeXTSTEP development environments encourage the use of MVC.
- Ruby on Rails
Read more »