On Sun, Apr 6, 2008 at 1:30 AM, Scott Roberts <[EMAIL PROTECTED]> wrote:
> >On Fri, Apr 4, 2008 at 3:32 PM, Tom Morris <[EMAIL PROTECTED]> wrote:

> > Thanks for the bug report.  Generally speaking event listeners should
>  > be conservative about checking the types of events they receive
>  > because the event registrations may get changed in a superclass or
>  > some other separate piece of code, so this should mainly be a
>  > performance issue, but it's still good to have it on the list to look
>  > at.
>  >
>
>  Something else to consider in addition to the performance issue is the
>  possibility a new bug is created by the addition of an event listener
>  that doesn't follow convention.  I've added a patch to the issue which
>  potentially corrects the issues.

Michiel has committed your patch.  Thanks.

I'd argue that it's more than a convention and that an event listener
that is making assumptions and isn't checking the events that it
receives is destined to fail eventually.  Arguably event listeners
should be tested by artificially injecting "bad" events to make sure
that they can handle them.

One common way that things can get screwed up is changes to listener
registration code up or down the class hierarchy.  Listeners are
registered, and events are delivered, on an instance basis, so they're
affected by registrations done by supertypes and subtypes.

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to