[newbie]Does Model + Morphic = MVC?

Lex Spoon lex at cc.gatech.edu
Wed Feb 20 18:23:07 UTC 2002


Andre Maloney <amaloney at earthlink.net> wrote:
> I'm trying to figure out where Model and its sublasses fits into the Morphic 
> world before I delve too deeply into any of the writings that explain MVC.
> 
> At first glance it appears that Morphs encapsulate view and controller. 
> 
> Is that too simplistic, and if so, what else do I need to be aware of? Is 
> this on the swiki anyplace (or anyplace else)?
> 

No, I think that's an excellent way to look at it.  Note that sometimes
Morphs also incorporate the model, too.

Alternatively, you could think of there not being controllers any more,
and there being a single system-wide controller that sends events to all
morphs in a standard way.


By the way, be sure to keep seperate the MVC approach to designing
programs that have graphics, and the MVC framework that is implemented
in Squeak.  Thus you can say things like: "you can use the MVC approach
in both MVC and Morphic."  :)



> Also, are there any general rules for when to sub-class Model?

Well, in Smalltalk, you can make a model without subclassing from Model.
 In fact, I never subclass from Model to begin with, and only change the
superclass from Object to Model if it comes to make sense.  If it never
seems obvious to do this, then don't worry about it, IMHO.



-Lex



More information about the Squeak-dev mailing list