[squeak-dev] Re: Algernon modification to register as an
eventListener into HandMorph
Andreas Raab
andreas.raab at gmx.de
Sat May 17 22:50:59 UTC 2008
Igor Stasenko wrote:
> Well, i think its more logical to do copy of events in
> EventRecorderMorph and RemoteHandMorph
> instead of HandMorph class. Really why such special event handlers
> like above, which collecting events, should rely on different class to
> receive a copy of events, instead of making copy themselves?
Robustness. I didn't even know that EventRecorderMorph and
RemoteHandMorph kept the last events and I have no idea whether that can
cause problems or not. Creating copies for the listeners (which are
different from filters btw; listeners are assumed to be passive and
consequently copying the event only serves the purpose to decouple the
listener processing from the internal processing later) makes the whole
mechanism more robust at very little cost. New clients simply cannot
break later processing by accidentally modifying the event. You have to
understand that this is a *very* low-level hook into the system - making
an error in your code *will* completely screw the environment so a
little caution is in order I think.
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|