[Zope3-dev] ILocation vs IContained

Jim Fulton jim at zope.com
Sun Jul 10 08:22:47 EDT 2005


Florent Guillaume wrote:
> I'm having a hard time grasping the reasons why we have both  ILocation 
> and IContained.

Overdesign on my part.

> class IContained(ILocation):
>     """Objects contained in containers."""
> 
> But ILocation provides a __parent__ already, which seems to imply  that 
> it's contained in it. No?
> 
> What use case makes us differentiate between the two?

The desire to distinguish ebtween objects that are container items
and objects that are simply located.  A good example is a site's
site manager.

Fred was correct when he said:

Fred Drake wrote:
 > My own understanding is this:
 >
 > - ILocation refers to the __parent__/__name__ API, which allows these
 > attributes to have None as a value.
 >
 > - IContained indicates that the object is actually contained in an
 > IReadContainer, not just that it can be contained.

And others are correct when they point out that this is inconsistent
with Contaner implementing IContainer.

I'd be happy to see IContainer go away.  I don't think the distinction
between ILocation and IContainer is worth the complexity they cause.

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