Re: [Zope3-dev] ILocation vs IContained

2005-07-10 Thread Jim Fulton

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:[EMAIL PROTECTED]   Python Powered!
CTO  (540) 361-1714http://www.python.org
Zope Corporation http://www.zope.com   http://www.zope.org
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



Re: [Zope3-dev] ILocation vs IContained

2005-07-09 Thread Fred Drake
On 7/9/05, Roger Ineichen [EMAIL PROTECTED] wrote:
 Contained is the mixin class for the __parent__ and __name__
 attributes or not?
 
 And we used it as this. Otherwise you have to implement
 __parent__  and __name__ in your own classes again and again.
 
 See the commet in the class:
 Stupid mix-in that defines `__parent__` and `__name__` attributes

zope.app.location.Location that comment as well, and doesn't imply
IContained.  So the ambiguity screams loudly as to its presence.  :-(


  -Fred

-- 
Fred L. Drake, Jr.fdrake at gmail.com
Zope Corporation
___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com



[Zope3-dev] ILocation vs IContained

2005-07-08 Thread Florent Guillaume
I'm having a hard time grasping the reasons why we have both  
ILocation and IContained.


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?

Florent

--
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of RD
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]


___
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com