[Zope-PTK] New tool proposal: portal_events

Ken Manheimer klm@digicool.com
Thu, 24 Aug 2000 10:44:29 -0400 (EDT)


> Date: Mon, 21 Aug 2000 20:13:37 -0400
> To: Tres Seaver <tseaver@digicool.com>, PTK Community <zope-ptk@zope.org>
> From: Andrew Wilcox <circle@gwi.net>
> [...]
> Do consider having an "Event" class with a single "event" object passed to
> notify().  Using an object-oriented approach would include these advantages:

I haven't used an event notification system like this, but the idea of
propagating an event object which manifests the event type and contains
the event metadata appeals to me, too.  This would be much like
class-based exceptions in python.  

The primary concern which i don't know enough to answer is whether there
would be performance problems, identifying event types by class
isinstance().  Filtering on events is likely to be a common occurrence
(um, event), while exceptions are, sorta by definition, uncommon (um,
exceptional).

I just don't know whether how frequency of isinstance() use scales up, and
i bet this is one thing place where guessing isn't a good guide - if it
really is attractive to go with class-based event objects, then the cost
of doing lots of isinstances on a shallow class hierarchy might should be
measured...

Ken