[Zope3-dev] Using parent references rather than context wrappers to represent containment

Martijn Faassen faassen at vet.uu.nl
Mon Aug 11 12:59:53 EDT 2003


Phillip J. Eby wrote:
> At 07:22 PM 8/10/03 +0300, Steve Alexander wrote:
> 
> >>    3. Optionally allow vies wo implement 'IContained' and add
> >>       'IContained' support to BrowserView.
> >
> >A content object does not contain its views. In the proposal you said "We 
> >don't want to mix up containment with other associations".
> 
> For what it's worth, in peak.web a view's context is the view that it was 
> found in, not the object it's adapting.  That is, if you have a content 
> object O, with a container C, then a view Vo of object O will have view Vc 
> of container C as its parent.  The overall structure looks like a ladder: 
> parallel verticals of view-to-view connections and conent-to-content 
> connections, with horizontal rungs of view-to-content references.

That's the way it works in (Zope 2) Silva as well. It is useful if you
intend to acquire views. It would make 'context' in ZPT code stand for 
what? In Silva we have 'view' for the view context and 'model' for the
content context, and this works fairly well. Of course I have no idea
whether a view acquisition hierarchy makes a lot of sense in Zope 3.

Regards,

Martijn




More information about the Zope3-dev mailing list