[BUG]Morph>>updateableActionMap

Withers, Robert rwithers at quallaby.com
Mon Mar 18 18:32:15 UTC 2002


Hi Jim,

I think your use of this framework is the first indication I have had of
someone using this framework in Squeak, aside from a single user in the core
(World enter/leave).  I think that's great!  It really is a more effective
way to wire components together in the Observer pattern.  It's more finely
grained to action/response.  If anyone else uses this mechanism, let this be
the heads up.  This framework has changed in 3.3alpha.  The changesets were
posted independently to the list, if anyone wants to test their code in 3.2.
Hmm, I don't seem to have a link handy.

I suppose that it was pretty aggressively changed and without notification
to the squeak list, beyond the changeset listing.  It comes from changesets
to move the multicast event framework to the NuBlu book code.  As Ned
mentioned, the new publish protocol is #triggerEvent: and friends, and the
other big change is in the removal protocol.  Registration has not changed
it's interface, for the most part.

I am not sure I see the two issues with your posted code, other than an
assumption that #setProperty:toValue: returns the value, like all good
Dictionary insertion protocols.  That said, I like your implementation
better.

Sorry for any trouble this caused you and I hope you like the new protocol
as well as you did the last one.  It was my insistence that got this code
into the update stream.

Rob

> -----Original Message-----
> From: Jim Benson [mailto:jb at speed.net]
> Sent: Monday, March 18, 2002 12:10 PM
> To: Squeak
> Subject: [BUG]Morph>>updateableActionMap
> 
> 
> Hi,
> 
> On my pilgrimage to 3.3 land for conversion, I noticed that one of my
> friends (#trigger:) had been murdered. Not even a grave 
> marker. Deprecation
> isn't pretty around here.
> 
> Trying to move forward with my life, I tried to manage as 
> best I could until
> I ran into:
> 
> Morph>>updateableActionMap
> 
>  | actionMap |
>  actionMap := self valueOfProperty: #myEvents.
>  ^actionMap == nil
>         ifTrue: [self setProperty: #actionMap toValue: self 
> createActionMap]
>         ifFalse: [actionMap]
> 
> While I can think of what a tentative fix would be, there are 
> at least two
> bugs here and need "someone in the know" to come up with a 
> proper solution.
> I would think it would be along the lines of:
> 
> updateableActionMap
> | actionMap |
>     ^ self valueOfProperty: #actionMap
>         ifAbsent: [ actionMap := self setProperty: #actionMap 
> toValue: self
> createActionMap.
>             actionMap].
> 
> 
> But I might be missing something. The #myEvents property 
> check threw me off.
> 
> Thanks,
> 
> Jim
> 
> 



More information about the Squeak-dev mailing list