Viewing in Morphic (was: Re: The Weekly Juan #4: "Smalltalk, Direct Manipula

J J azreal1977 at hotmail.com
Wed Nov 15 06:14:27 UTC 2006


>From: Andreas Raab <andreas.raab at gmx.de>
>Reply-To: The general-purpose Squeak developers 
>list<squeak-dev at lists.squeakfoundation.org>
>To: The general-purpose Squeak developers 
>list<squeak-dev at lists.squeakfoundation.org>
>Subject: Viewing in Morphic (was: Re: The Weekly Juan #4: "Smalltalk, 
>Direct Manipulation and End User   Programming")
>Date: Mon, 13 Nov 2006 20:58:59 -0800
>
<snip>
>
>So, I guess I have to correct myself, Morphic does indeed support viewing 
>via step-polling (but I still wouldn't call that a viewing architecture ;-)
>
>Cheers,
>   - Andreas
>

I don't know much about how morphic does it's work, but I definitaley think 
polling is bad. :)

I think how Dolphin does it is really nice.  For those who don't know, in 
Dolphin they use MVP (Model View Presenter).  The basic difference in the 
concept is: the View is responsible for displaying itself, as well as 
responding to user events.  The Presenter is the glue between the Model and 
the View.  It can recieve events from the View as high level or low level as 
it want.  I.e. it can get an event like "user has selected 5 rows and did 
(via right click) the 'make bold' command", or it can go as low as asking 
for every key press and/or mouse move.

Every model has to be derived from the Model class, and you do have to take 
care that if one of your Model methods updates another part of the model 
(e.g. the view requests to add a transaction, but this causes the model to 
update it's balance), you have to send an event explicity.

As far as the normal model changes, you don't have to send events yourself.  
In the presenter you just create an "Aspect" for each field you are going to 
manage.  This part is kind of like Magritte, but you specify the Aspect 
(e.g. SelectBoxAspect for enum type values) in the Presenter instead of the 
Model.  I believe the Aspect class does a "#send: anEvent on: aModel", to 
handle all other views getting updated.  And in this way, you have to send 
the event yourself if you call those methods directly, but no polling has to 
be done.

This is how I think it works anyway (I didn't know enough about smalltalk at 
the time to even check).  I hope it doesn't do polling! :)

_________________________________________________________________
Get today's hot entertainment gossip  
http://movies.msn.com/movies/hotgossip?icid=T002MSN03A07001




More information about the Squeak-dev mailing list