[Zope3-dev] Object hub?
Jim Fulton
jim at zope.com
Tue Dec 23 12:27:37 EST 2003
The original puroses for the object hub were:
1. To allow location-independent object references. These were
references that remained valid even if the referenced object
was moved.
This need is now supported through direct object references,
which were made possible through parentgeddon. You can now
have a direct reference to an object without losing location
information.
2. Track containment or location relationships.
This is now handled through ILocation/IContained
and ISublocations/IContainer.
3. Provide compact identifiers for use in indexing.
Having this broken out into a separate component (versus
providing the capability as an internal catalog implementation
as was done in Zope 2), supports cross-index/cross-catalog
merges.
I think that there is still a role for an object hub, although
it is now a much smaller role, and far less central.
I propose to to do away with the object hub as a service, replacing it
with a utility.
I further suggest that provide a two-way mapping between object references
and short ids (integers).
We will define an interface (like):
class IObjectReference(IHashKey, IPicklable):
"""An object reference
"""
def __call__():
"""Return the referenced object
"""
When we register the object with the utility, we'll adapt it to this interface
to get a reference.
Jim
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the Zope3-dev
mailing list