[Zope3-dev] Containment constraints

Jim Fulton jim at zope.com
Tue Dec 23 15:59:39 EST 2003


Roché Compaan wrote:
> The containment constraints are yummy. Just one thing I am concerned
> about is that the current implementation (__setitem__.precondition on an
> Interface) may lead to a lot of dead chickens. I seem to be ending up
> with a lot of interfaces that only subclass IContainer and set
> preconditions.

Yes, and likewise for the __parent__ constraint.

> Add to that the class implementation and ZCML one has to
> write for each interface and the dead chickens start to smell.

The zcml one has to write?  I don't follow this.

> Should I just get used to it or am I missing some zen.

Well, this is new. We need to get some experience.  I'm sure
it can be improved.  I'll note that implementing containers is
now *much* simpler than it used to be.

(In fact, I really need to update the slided, because, at the
  Bangalore sprint a new zcml directive was added that vastly
  simplifies defining the contents, add and index pages.)

I suspect that a zcml directive and/or Python api could automate
certain aspects of defining these interfaces. Proposals are welcome.

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