[Zope3-dev] Getting the parent object
Stephan Richter
srichter@cbu.edu
Sat, 30 Mar 2002 10:58:23 -0600
At 04:46 PM 3/30/2002 +0000, Chris Withers wrote:
>Stephan Richter wrote:
> >
> > Unless there is a way to get back to the parent otherwise, I propose that
> > we set a __parent__ attribute in an object, when it is added to the
> > container. Therefore, all containers are required to implement that
> feature.
>
>Circular references.... yum ;-)
Well, it would be simply a double linked list, a very common data type.
>Well, I don't have a problem with a child needing to know it's parent. Whether
>or not this should be stroed in yet another __something__ variable on the
>child
>is another matter...
Sure.
>How about a much more generic Relationship service which could store this
>information?
This would be too tedious to keep up with.
>Seems that would be much more Zope 3 like in that it doesn't impose
>restrictions
>on the classes implementing thre __parent__ thing. It also makes relationships
>much mroe dynamic and allows easily things like multiple parents and
>children...
>
>how does that sound?
But the registry would be HUGE. Then you end up doing exactely what the
ZODB tries to avoid; you centralize the info and make this center point the
bottle neck for everything.
>PS: Could the ObjectHub be extended to cover this or is it mroe appropriate to
>get a new service completely?
ObjectHub could be used for that/
But, see Steve's mail. I did not know Wrappers were guaranteed after
traversal. So that is the solution then. Now wrappers seem a million times
cooler than before.
Regards,
Stephan
--
Stephan Richter
CBU - Physics and Chemistry Student
Web2k - Web Design/Development & Technical Project Management