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

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 13: Line 13:
# 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 in the name, the pattern is composed of three parts<ref name="MVC" />:
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.
;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.
;View : Renders the model in a ''hopefully'' easily understandable and usable user interface.
Line 22: Line 22:


<blockquote>
<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 <pre>[model/controller]</pre>.<ref name="Model 1" />
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>
</blockquote>


=Model 2=
=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=
<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 />