[Zope-dev] Re: No events in zope.annotation

Tres Seaver tseaver at palladion.com
Tue Jul 15 19:02:15 EDT 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stephan Richter wrote:
> On Tuesday 15 July 2008, Tres Seaver wrote:
>>> Comments? Silence is consent as always.
>> I must be missing something:  why would you catalog annoations as though
>> they were separate content objects?  The entire point of annotations was
>> to be "meta" about some other content object.
> 
> Right, but annotations are still content in their own right.

Not by design, anyway, although you might be using them that way.  They
aren't traversable (by default), nor are they "located".

Why not just fire the event in whatever application code you are using
to stash the annoation?   However this works out, any events fired
should not be of the same type as events that "normal" content emits.

> And we fire 
> events that are specific to annotations all the time, for example in workflow 
> instances.

The events are not *about* the annotation:  they are about the state
transition.  In fact, one way to implement workflow history would be to
create and add the annotation *in the subscriber* to the state
transition event.

>> -1 to any change which encourages abusing them to look like "items" in
>> the target object as a container.
> 
> It does not have to be like a container. It could be:
> 
> IAnnotationAdded(object, key, annotation)
> 
> Right now, I have no hook that allows me to do something else after I added a 
> new annotation for an object.

How likely is it that such a hook is generically useful (compared to
just publishing the event, or doing the work, in the code which is
adding your custom annotations?)  It sounds as though you are creating a
framework for which such events are meaningful, but I would be extremely
surprised if that framework expected "foreign code to add its annotations.

> Events are designed to allow expanding the 
> system without touching the original code. And that's what I want to do. We 
> do it in all the other packages of Zope 3.


Tres.
- --
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIfSx3+gerLs4ltQ4RAkYkAKDMNcAcPF9uorwX3rXFC8MlonyCcwCfUyri
f3nMn9kLcdQS1l6XQBC0vms=
=vFd6
-----END PGP SIGNATURE-----



More information about the Zope-Dev mailing list