[self-interest] Model View Controller and the Observer pattern

Jecel Assumpcao Jr jecel at merlintec.com
Mon Aug 27 23:22:10 UTC 2001


On Monday 27 August 2001 03:13, Thomas Kuehne wrote:
> AFAIK, the original creator of MVC was Trygve Reenskaug and not the
> group involving Dan Ingalls and Alan Kay you are referring to.

Thanks for the correction.

  http://www.martinfowler.com/isa/mvc.html

Having only seen pictures of Smalltalks before -80, I wasn't aware that 
their user interfaces were not MVC based (since they look so similar).

> Also, said Squeak group still maintains both MVC and Morphic.

True, in a sense. And they have promised to continue having support for 
MVC applications in the future. I was just mentioning that more and 
more Squeak applications break if you try to run them under MVC. All 
new code at "Squeak Central" is Morphic.

> Moreover, even if they exclusively went the Morphic direction that
> would just tells you that for their particular purposes the direct
> manipulation and stepping paradigm does the job.

Exactly.

> It does not,
> however, imply that Morphic is the better choice in all
> circumstances. In fact, the current Squeak way of supporting Morphic
> is badly in need of a polish, AFAIC. It is way to slow for anything
> but the most minute toy examples.

Morphic is much less efficient than MVC and isn't practical except on 
the most modern computers. It certainly wouldn't have been reasonable 
on the type of machines Smalltalk ran on for the first 25 years. People 
are not finding it very usable on current PDA devices.

Morphic is based on the "one object, one view" philosophy. If you want 
multiple views (a chart and a spreadsheet on the same set of numbers) 
then it won't work for you. That is not true of Morphic in a subjective 
language like Us, however.

Morphic isn't a good match for a single inheritance class based 
language like Squeak Smalltalk. A PieChartMorph will extend an object 
like FancyDictionary (by having one at its parent) to have a graphical 
representation. In a class based language, having an instance of 
PieChartView delegate to an instance of FancyDictionary wouldn't work 
too well (we want data to flow *from* aFancyDictionary *to* 
aPieChartView and the Observer Pattern does that). In other words, in 
Morphic a View *is* a Model. The only way to have that in Squeak is to 
merge both classes into one. In order for that not to be come too nasty 
they use a dictionary to allow per instance "slots".

Different tools for different jobs is what I always say. And no tool is 
ever better than another in an absolute sense. So I don't think we 
disagree at all except, perhaps, for my point that it is not 
unreasonable to have a Smalltalk without the Observer Pattern.

-- Jecel



More information about the Self-interest mailing list