CSC/ECE 517 Fall 2011/ch3 3g gm: Difference between revisions
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
This article describes new research in MVC. | This article describes new research in MVC, which is to say it discusses adaptations and implementations of MVC. | ||
=Introduction= | =Introduction= | ||
[http://en.wikipedia.org/wiki/Model-view-controller Model View Controller (MVC)] is a compound design pattern which was first described by Trygve Reenskaug in 1979. | [http://en.wikipedia.org/wiki/Model-view-controller Model View Controller (MVC)]<ref name="MVC">[http://en.wikipedia.org/wiki/Model-view-controller Model View Controller (MVC)]</ref> is a compound design pattern which was first described by Trygve Reenskaug in 1979. | ||
== MVC == | == MVC == | ||
The MVC design pattern is used to remove business logic (the model) from the user interface (the view). The purpose of this is, at least, twofold: | [[File:ModelViewControllerDiagram2.png|right]] | ||
The MVC design pattern is used to remove business logic (the model) from the user interface (the view). | |||
The purpose of this is, at least, twofold: | |||
# By abstracting the model from the view, multiple views can act on single model. | # By abstracting the model from the view, multiple views can act on single model. | ||
# The smaller chunks of code which make up constituent parts of the overall program are more manageable and testable. | # The smaller chunks of code which make up constituent parts of the overall program are more manageable and testable. | ||
As clearly indicated by the name, the pattern is composed of three parts<ref name="MVC" />: | |||
;Model: This handles the business logic, including data persistence, state information and notificaitons. | |||
;View : Renders the model in a ''hopefully'' easily understandable and usable user interface. | |||
;Controller: Handles the stuff in between the Model and the View. | |||
== | =Model 1= | ||
[http://en.wikipedia.org/wiki/Model_1 Model 1]<ref name="Model 1">[http://en.wikipedia.org/wiki/Model_1 Model 1]</ref> is probably the most basic of all MVC implementations, and because of this, it mashes the controller and view together. | |||
<blockquote> | |||
Although conceptually simple, this architecture is not conducive to large-scale application development because, inevitably, a great deal of functionality is duplicated in each <nowiki>[model/controller]</nowiki>.<ref name="Model 1" /> | |||
</blockquote> | |||
=Model 2= | |||
[http://en.wikipedia.org/wiki/Model_2 Model 2]<ref name="Model 2">[http://en.wikipedia.org/wiki/Model_2 Model 2]</ref> is an adaptation of MVC for internet applications. Model 2 makes extensive use of JSP and servlets which act as the controller. | |||
=References= | |||
<references /> |
Latest revision as of 16:21, 6 October 2011
This article describes new research in MVC, which is to say it discusses adaptations and implementations of MVC.
Introduction
Model View Controller (MVC)<ref name="MVC">Model View Controller (MVC)</ref> is a compound design pattern which was first described by Trygve Reenskaug in 1979.
MVC
The MVC design pattern is used to remove business logic (the model) from the user interface (the view). The purpose of this is, at least, twofold:
- By abstracting the model from the view, multiple views can act on single model.
- The smaller chunks of code which make up constituent parts of the overall program are more manageable and testable.
As clearly indicated by the name, the pattern is composed of three parts<ref name="MVC" />:
- Model
- This handles the business logic, including data persistence, state information and notificaitons.
- View
- Renders the model in a hopefully easily understandable and usable user interface.
- Controller
- Handles the stuff in between the Model and the View.
Model 1
Model 1<ref name="Model 1">Model 1</ref> is probably the most basic of all MVC implementations, and because of this, it mashes the controller and view together.
Although conceptually simple, this architecture is not conducive to large-scale application development because, inevitably, a great deal of functionality is duplicated in each [model/controller].<ref name="Model 1" />
Model 2
Model 2<ref name="Model 2">Model 2</ref> is an adaptation of MVC for internet applications. Model 2 makes extensive use of JSP and servlets which act as the controller.
References
<references />