[Zope3-dev] Re: proposed changes to contained helper functions
Shane Hathaway
shane at zope.com
Fri Oct 3 11:01:18 EDT 2003
Philipp von Weitershausen wrote:
> Fred L. Drake, Jr. wrote:
>
>> Garrett Smith writes:
>> > It seems your application is a bit different from a typical
>> __setitem__ > scenario, where the child is named.
>>
>> That depends on whether you're thinking of sequence __setitem__ or
>> mapping __setitem__. ;-( The DOM is mostly about sequences of
>> children; the children have indexes, but not names. The indexes are
>> not specific to the node being referenced, but change as nodes are
>> added and removed before the child in the parent. (Think of an
>> element node as a list of children.)
>
>
> Correct. Basically, I would like to express parenthood without having to
> make any assumptions on a) how the parent names its child (if it names
> it at all) nor b) how it stores a reference to it (if it stores one at
> all).
Giving a unique name to each child serves the purpose of making all
children potentially addressable via URL. That's one of the sweet spots
of Zope; it makes the system discoverable and clear. I think a decision
to not use this pattern should be weighed carefully. In particular, if
an object is not addressable via URL, it is quite difficult to provide a
Web user interface for it or any of its descendants.
Shane
More information about the Zope3-dev
mailing list