www.cryer.co.uk
Brian Cryer's Web Resources

MVC

MVC
Model View Controller.

Model View Controller is a design architecture for interactive applications that divides an application into three layers:

  1. Model. The model represents the business data and logic that goes with that data.
  2. View. The view provides the public interface to the model, for example the GUI. The View provides a means of displaying portions of the business data provided by the model.
  3. Controller. The controller defines the application behaviour. The controller manages events that affect the model or view.

A partial summary of MVC is that in an application the model is the data, the view is the user interface and the controller is the logic and glue between the two.

MVC was originally developed to map the traditional input, processing and output roles of command line applications into a corresponding model that could be applied to GUI applications. So whereas the traditional model was:

Input → Processing → Output

these map to:

Controller → Model → View

it must be stressed that the inter-relationships between the model, view and controller are more complex than this simple comparison would suggest, and is normally represented as:

controller View
 
Model

or

controller
View
  ↑↓
Model

For more information see: