[Zope3-dev] renaming MementoBags..conclusions?

Shane Hathaway shane@zope.com
Wed, 15 May 2002 14:57:41 -0400


Jim Fulton wrote:
> Shane Hathaway wrote:
>>IMHO your insight actually leads me to believe even more that
>>IAnnotations is the right name.  It's true that an annotation can be
>>more than a string, but we learned from Zope 2 that we have to avoid
>>storing objects of non-"core" types in annotations. 
> 
> 
> I don't want to limit these things this way. For example, I might 
> want to store objects that I can make security assertions about.
> In any case, we're going to store complex objects (e.g. tuples 
> of dictionaries) in these things.

Right.  All "core" types are safe.

>>Otherwise, when the
>>user uninstalls something that created complex annotations, Zope can no
>>longer load the annotated objects.
> 
> 
> That's true of any object. Why does it matter more in the context of annotation?
> I think it doesn't.

Because annotations can appear anywhere, and the user isn't always aware 
of them.  Say you add an annotation to the root object that later can't 
be loaded because the class disappears.  In the worst case, if the 
annotations are stored as part of the root object, you can no longer 
load the root object.  In the best case, assuming each annotation is 
stored as a separate persistent object and maybe even located away from 
the root object, the machinery that loads and stores annotations has to 
avoid tripping over broken annotations.

I'm just trying to avoid a Zope 2 pitfall.

Shane