[Zope3-dev] I've updated the proposal on using parent references rather than context wrappers

Phillip J. Eby pje at telecommunity.com
Wed Aug 13 10:31:49 EDT 2003


At 05:31 AM 8/13/03 -0400, Jim Fulton wrote:
>Phillip J. Eby wrote:
>>At 05:18 PM 8/12/03 -0400, Jim Fulton wrote:
>>
>>>It's now in the Wiki at:
>>>
>>>http://dev.zope.org/Zope3/ParentGeddon.
>>>
>>>Comments are still welcomed.
>>
>>In the proposal, you say that "you can't create a mapping in which the 
>>identity of an object is used as a key, because an object's identity 
>>isn't constant."  Do you mean to say that a persistent object's in-memory 
>>'id()' is not constant?
>
>Right, and neither is a non-persistent object's, accross runs. :)
>
>It is temptin to use a persistent object's _p_oid (or some variation
>of it), but that has two disadvantages:
>
>- It requires persistense,

Doesn't the object hub?  I mean, sure you could use paths to access some 
non-persistent object pickled inside a persistent one, currently, but 
direct reference isn't going to work for that.  You'll just end up with two 
copies of the non-persistent object, won't you?


>- the _p_oid isn't retained accross export/import operations. Perhaos
>   I shouldn't worry about this, but I do.  I imagine a situation where
>   objects are archived and then restored.
>
>These might be overcomable.

If oids were GUIDs, they could be retained across export/import without 
fear of collision.  OTOH, they couldn't be used for copying, since they 
would then *update* an existing object.  (But, that's a *feature* in many 
circumstances.)  I suppose you'd have to have 'Import (Copy)' and 'Import 
(Update)' options.




More information about the Zope3-dev mailing list