CSC/ECE 517 Fall 2011/ch3 3g gm: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
(Created page with "= New Research In MVC = [http://en.wikipedia.org/wiki/Model-view-controller Model View Controller (MVC)] is a compound design pattern{{cite book | last1=Freeman | first1=Eric | l...")
 
No edit summary
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
= New Research In MVC =
This article describes new research in MVC, which is to say it discusses adaptations and implementations of MVC.
[http://en.wikipedia.org/wiki/Model-view-controller Model View Controller (MVC)] is a compound design pattern{{cite book | last1=Freeman | first1=Eric | last2=Freeman | first2=Elisabeth | last3=Sierra | first3=Kathy | last4=Bates | first4=Bert | title=Head First Design Patterns | isbn=0-596-00712-4}} which was first described in 1979.
 
=Introduction=
[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 ==
[[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.
# 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:

  1. By abstracting the model from the view, multiple views can act on single model.
  2. 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 />