Model View Controller
'Model-View-Controller' (MVC)
is an implementation architecture often used for user-interfaces.
It allows for a separation between the implementation of the visible aspects
of a user-interface and the logic that governs its behaviour.
Unfortunately, the term MVC is used to mean quite different things by different
people. This document attempts to explain some of the architectures that are
described as being "MVC" and point out their differences.
MVC in Apple's Cocoa Framework
Apple's
Cocoa framework
gives strong support for the use of MVC - in fact it is almost a requirement
for proper use of the Cocoa framework. As explained in
Apple's doc about Cocoa design patterns,
the
model objects encapsulate data and behaviour,
the
view objects present information to the user and allow for
interaction,
and the
controller objects intermediate between the model objects
and the view objects. The controller objects "know" about the model objects and
the view objects, but the model and view don't "know" about each other
- all data flow goes via the controller.
At Apple's developer conference "WWDC 2003",
James Dempsey sang a song about MVC.