Squeak+Event+Dependencies: The solution

Stephan Rudlof squeak-dev at lists.squeakfoundation.org
Wed Oct 2 04:01:25 UTC 2002


Thanks!

Greetings,

Stephan

Stephane Ducasse wrote:
> Hi all
> 
> just to pass the information about how to use event to implement 
> dependency mechanism.
> I wrote a wiki page 1214 (I fleshed Squeak+Event)
> Here how to use event to have a changed, update: behavior. This is the 
> way to avoid all these ugly update methods
> full of case statements. The dark is losing a bit today.
> 
> MyModel>>lifes: aNumber
> 
> 	  lifes := aNumber.
> 	  self trigger: #lifesChanged.
> 
> MyUI>>initialize
> 
> 	  super initialize.
> 	  domain := MyModel new.
>    	  domain when: #lifesChanged send: #lifesChanged to: self.
> 
> MyUI>lifesChanged
> 
> 	  lifeDisplay value: domain lifes
> 
> 
> Take care the following in for Squeak32 the interface slightly changed 
> in 3.3
> 
> 
> Other event pages:
> *http://minnow.cc.gatech.edu/squeak/2700*
> *http://minnow.cc.gatech.edu/squeak/2477*
> 
> 
> Have fun. May be now we should get rid of all the update and changed: 
> methods. :)
> 
> Dr. Stéphane DUCASSE (ducasse at iam.unibe.ch) 
> http://www.iam.unibe.ch/~ducasse/
>   "if you knew today was your last day on earth, what would you do
>   different? ... especially if, by doing something different, today
>   might not be your last day on earth" Calvin&Hobbes
> 
> 
> 


-- 
Stephan Rudlof (sr at evolgo.de)
   "Genius doesn't work on an assembly line basis.
    You can't simply say, 'Today I will be brilliant.'"
    -- Kirk, "The Ultimate Computer", stardate 4731.3




More information about the Squeak-dev mailing list