

































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


































10/13/
Professor John Canny
Fall 2004
10/13/
Model-view controller* Why do we need it?* Changing the display* Event flow* Dragging at interactive speeds
Interactive application programming* Callbacks* Multi-threaded programming
10/13/
Information the app is trying to manipulate
Representation of real world objects
Model
View Controller
10/13/
Blue circles: 4Cardinal squares: 2
10/13/
Implements a visual display of the model
May have multiple views
Any time the model is changed, each viewmust be notified so that it can change
later
Model
View Controller
10/13/
Blue circles: 4Cardinal squares: 2
10/13/
Blue circles: 4Cardinal squares: 2
10/13/
View and controller are tightly intertwined
Almost always occur in pairs
Many architectures combine into a singleclass
Model
View Controller
10/13/
Combining MVC into one class or using globalvariables will not scale
changes
Separation eases maintenance
work
(recall, view handles selection)
10/13/
Blue circles: 4Cardinal squares: 2
10/13/
How do we redraw when shape moves?
10/13/
Blue circles: 4Cardinal squares: 2
10/13/
Erase and redraw
Move in model and then redraw view
all
views to redraw themselves in order