[Zope3-Users] Re: RFC 4122 UUIDs

Martin Aspeli optilude at gmx.net
Sun Apr 8 11:56:08 EDT 2007


Fred Drake wrote:
> On 4/6/07, Philipp von Weitershausen <philipp at weitershausen.de> wrote:
>> How is there a ZCML pain? Simply register the adapter for all
>> IAnnotatable objects. Typically your content objects are annotatable
>> anyway because you want DublinCore stuff etc.
> 
> This sounds like this will result in huge numbers of UUIDs being
> generated for objects that aren't "syndicatable content" in this
> application.  The subscriber should probably be registered for objects
> that can be syndicated, not everything, to avoid useless CPU load and
> database bloat.
> 
> Of course, as the OP suggested there's already an annotation for
> syndication-related information, I'd just add it to that, and not use
> a separate annotation.

Another common pattern is to invent a new marker interface, e.g. 
IUUIDAware, which perhaps inherits from IAnnotatable so that it's clear 
there are annotations involved. Then you register adapters from that, 
and use a generic ZCML statement to give various objects this marker. In 
a CMF world, for example, we may do:

<class class="Products.CMFCore.DynamicType.DynamicType">
     <implements interface=".interfaces.IUUIDAware" />
</class>

Martin



More information about the Zope3-users mailing list