[Zope3-dev] Re: zope.annotation dependency to
zope.app.container.contained
Christian Zagrodnick
cz at gocept.com
Wed Aug 15 07:43:53 EDT 2007
On 2007-08-09 20:51:26 +0200, Philipp von Weitershausen
<philipp at weitershausen.de> said:
> Roman Joost wrote:
>> we're doing some dependency checking at gocept and I discovered that
>> zope.annotation depends on zope.app.container in its factory.
>>
>> What shall we do with this dependency to zope.app.container? Moving this
>> factory to zope.app is probably not the best solution.
>
> To be clear, zope.annotation doesn't depend on zope.app, it depends on
> zope.app.container which is its own package and egg (and in fact,
> zope.annotation's dependencies are refreshingly few). The real problem
> is that zope.app.container depends on a whole bunch of other things.
> The question is why.
Okay, actually I think that zope.annotation uses IContained. This is
just wrong but also results in an underspecification of IContained:
class IContained(ILocation):
"""Objects contained in containers."""
When you read it very carefully you figure that it actually says is
that object.__parent__[object.__name__] would result in the object
again.
IContained states how you can get the object from the __parent__.
ILocation doesn't do that.
For the annotation factory using zope.location and ILocatable would be
sufficient. So we could get rid of the zope.app.container dependency.
We should be a bit more specific about the IContained interface. Does
it make any sense to have an IContained object without __name__. I
think not. Chaning that would make __name__ a required attribute on
IContained.
Comments?
--
Christian Zagrodnick
gocept gmbh & co. kg · forsterstrasse 29 · 06112 halle/saale
www.gocept.com · fon. +49 345 12298894 · fax. +49 345 12298891
More information about the Zope3-dev
mailing list