CSC/ECE 517 Fall 2011/ch3 3g gm
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 />