MVC song

Ralph Johnson johnson at cs.uiuc.edu
Mon Jul 17 05:15:11 UTC 2006


The problem is that the song is NOT about Smalltalk MVC.  In this
song, the controller is a layer between the view and the model, which
usually means it is a mediator.  The song also says that the
controller is copying values from one field to another, which also
indicates that it is a mediator.  However, in true MVC, the controller
is a strategy for handling events.  The events come directly to it,
rather than to the view.  The controller changes the model, but it is
not notified by the model.  When the user presses a key or moves the
mouse, the controller receives the event.  It checks with the view to
map mouse locations into model coordinates, then interacts directly
with the model.  If it changes the model then the model notifives all
dependents (observers), which notifes the view, which redisplays.

The song desribes Ivar Jacobson's Model/Interface/Control, in which
the Control is responsible for an entire use case.  It is not MVC.
Jacobson's model is like the MVC model, but his Interface is a
combination of View and Controller and his Control is not at all like
a real Controller.

-Ralph Johnson



More information about the Squeak-dev mailing list