[Zope3-dev] Some Z3 thoughts

Jim Fulton jim at zope.com
Fri Oct 29 14:28:14 EDT 2004


Jim Washington wrote:
> Jim Fulton wrote:
> 
>> Lennart Regebro wrote:
>> > Jim Fulton wrote:
>> ...
>>
>> >>> Inconstistencies:
>> >>>
>> >>>   - ContainerTypesCONSTRAINT / ItemTypePRECONDITION ???
>> >>>     They do the same thing!
>> >>
>> >>
>> >>
>> >> No, they don't.  They are both about constaining the containment
>> >> relationship, from different ends.
>> >
>> >
>> > Yeah, but one is called contraint, and the other precondition. ;)
>> > No big deal, it just stood out to me as an inconsistency in something
>> > othwerwise carefully consistent.
>>
>> Ah, I see what you mean. Note that I'm not very happy with this yet. I 
>> think
>> we're going to find a better way to do this.
>>
>> Also note that there is already a simpler way to do this.  See the 
>> containment
>> section in:
>>
>>    http://dev.zope.org/Zope3/programmers_tutorial.pdf
>>
> I was looking at that, and mutual relationships (A can only be in B, and 
> B can only contain A) are still not trivial to do, since you need one 
> defined before you can use the other, and vice-versa. 

Yup. You hit the nail on the head.

 > The work-around
> seemed like unnecessarily multiplying categories.  Could containment 
> policy go in ZCML instead?  The activity seems to be more about 
> configuration than behavior.

Sometimes it is, sometimes not. It is when, for example, a container
implementation really expects it's items to have certain attributes,
or the order way around.

In any case, we realize that we need to be able to specify constraints
outside the interfaces.  I suspect that this might take the form of
subscribers that can veto estaiblishing the containment relationship.
It is likely that we'll want to be able to express these in ZCML.

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