[Zope-dev] RFC: RelationAware class for relations between obj ects

Casey Duncan casey@zope.com
Thu, 8 May 2003 16:55:19 -0400


In Zope applications, it is never a good idea to refer to oids from the=20
application level because they can change out from under you at arbitrary=
=20
times, such as rename, cut/paste, export/import, etc.

This is one of the basic reasons why ObjectHub exists, as Shane eluded.

-Casey

On Thursday 08 May 2003 03:27 pm, sean.upton@uniontrib.com wrote:
> So the answer of what acts as a reference id for the referred-to object=
 is:
> "Whatever the best id that your framework provides you is."
>=20
> If your framework is Zope3, a hubid is what you should use.  In Zope2, =
a
> path or tuple containing (storagename, oid).  In ZODB-sans-Zope, an oid=
 (or
> a (storagename, oid) tuple with the storagename an empty string).
>=20
> I wonder if a single framework could adapt to fit the needs of all 3?  =
It
> seems doable (different plugins to store the IDs, 'traverse' to the
> objects), I think...
>=20
> Sean
>=20
> -----Original Message-----
> From: Shane Hathaway [mailto:shane@zope.com]
> Sent: Thursday, May 08, 2003 12:15 PM
> To: sean.upton@uniontrib.com
> Cc: maxm@mxm.dk; zope-dev@zope.org
> Subject: Re: [Zope-dev] RFC: RelationAware class for relations between
> obj ects
>=20
>=20
> sean.upton@uniontrib.com wrote:
> > More in response to Shane than to Max M: I thought that one of the
> > continuing justification for ObjectHubs was that hubids were consiste=
nt
> > across multiple mounted storages, but oids were not?  How could the
> > universal id problem be addressed at a lower level than Zope2 or Zope=
3 in
> > this case?
>=20
> When relationships are applied to Zope, they will always use hub IDs.=20
> Outside Zope, mounting and traversal don't always apply.
>=20
> > Then it starts to get amusing. One of the primary reasons for the=20
> > objecthub was to enable relations. So if the relations get implemente=
d=20
> > in in ZODB but need some functionality, will it not end up as a=20
> > duplication of efforts?
>=20
> Don't assume there is actually any separate effort going on.  The point=
=20
> of all of this talk is to discover in what ways the proposed=20
> relationship management is insufficient.  Once understood, the ideas ca=
n=20
> come together.
>=20
> Shane
>=20
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://mail.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists -=20
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope )
>=20