[Zope-dev] shrinking the ZTK: a proposed solution

Martin Aspeli optilude+lists at gmail.com
Tue Jan 5 11:10:04 EST 2010


Jim Fulton wrote:

> - When we refactor zope.app.foo to be zope.foo (or something else),
> rather than changing
>    zope.app.foo to use zope.foo, just leave zope.app.foo alone, if possible.

One problem with this is that if you have interfaces for which there are 
components registered, this can make it impossible to support both packages.

For example, zope.app.container had IObjectAddedEvent. This is now in 
zope.lifecycleevent (it spent some time in zope.container, too, I think).

If I have a system where some packages use the "new" zope.lifecycleevent 
and fire events from there, and I have an event handler registered for 
zope.app.container.interfaces.IObjectAddedEvent, that won't get called, 
unless zope.app.container.interfaces.IObjectAddedEvent is a 
compatibility import for zope.lifecycleevent.IObjectAddedEvent.

This happened in Plone, by the way, when people started using things 
like z3c.form. So we certainly appreciated people changing zope.app.* in 
tandem with the refactoring. :)

Martin

-- 
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book



More information about the Zope-Dev mailing list