[Zope-dev] zope.container analysis

Chris McDonough chrism at plope.com
Fri May 15 01:41:34 EDT 2009


On 5/14/09 11:05 PM, Chris McDonough wrote:
> zope.container (32 transitive dependencies) has some possibly low-hanging
> dependency  tease-apart fruit.  Does anyone have any ideas about to sort out the
> below, particularly with externalizing the mentioned interface dependencies?
>
> - It depends on zope.filerepresentation but depends only on its interfaces
>     IReadDirectory, IWriteDirectory, and IDirectoryFactory.
>     (zope.filerepresentation has 32 transitive dependencies).

I found out that zope.container<->zope.filerepresentation is a direct circular 
dependency and that zope.filerepresentation is a package containing only 
interfaces.  So breaking this dependency won't get us much for zope.container. 
OTOH, breaking zope.filerepresentation's dependency on zope.container might be a 
win (I dont know what else depends on zope.filerepresentation). 
zope.filerepresentation depends only on zope.container.interfaces.IReadContainer 
and zope.container.interfaces.IWriteContainer.

> - It depends on zope.app.dependable but depends only on its interfaces
>     IDependable and DependencyError.  (note: zope.app.dependable might
>     be a candidate to be called zope.dependable as it depends on no other zope.app
>     packages; it does depend on about 20 other zope.* packages transitively tho).

I fixed this by using a zcml:condition statement on an event subscriber.. if 
zope.app.dependable is not installed, nothing could have been registered for the 
IDependable interface which a "CheckDependency" subscriber is using to figure 
out dependents, so there's no use registering the subscriber.

> - It depends on zope.publisher, but only its interfaces browser.IBrowserRequest,
>     browser.IBrowserPublisher, NotFound, IDefaultViewName,
>     xmlrpc.IXMLRPCPublisher, and IPublishTraverse.
>
> - I was able to break a runtime logic dependency on zope.traversing by
>     disusing zope.traversing.api.getPath in favor of using
>     ILocationInfo(object).getPath().  The rest of the runtime dependencies on
>     zope.traversing are interface dependencies (ITraversable, IContainmentRoot).

These are still up for debate.

- C


More information about the Zope-Dev mailing list