CMPT 212
Object-Oriented Applications Design in C++
Fall 1997
Lecture 33
Friday, November 21, 1997
Mode/View/Controller Architecture
The
model/view/controller
(
MVC
) architecture is a way of designing a GUI application.
The data which a program uses can be displayed in various ways.
Spreadsheet data can be displayed in a table or in a graph.
A word processor may have the same document open in more than one window.
The application stores the data in some format (the
model
) but has different ways of displaying it (the
views
).
The
controller
portion of the application has two purposes:
coordinates the user's interaction with views to update the model,
ensures that the views show the latest updates of the model.
MVC architecture:
We can use callback functions to update the views then the model changes.
Each view registers a callback function with the controller.
When the model is changed, the controller will call each callback function so that the views are updated.
The MVC architecture is useful in other types of applications, but is very appropriate for GUI applications.
Return to lecture notes index
Lectures
This page is maintained by
simpson@cs.sfu.ca
.
Last updated on 24 Nov 1997.