[Zope3-dev] Using parent references rather than context wrappers
to represent containment
Steve Alexander
steve at z3u.com
Sun Aug 10 20:22:59 EDT 2003
> I'd really like to get comment on the issues above. Absent,
> comment, here is how I'm thinking of resolving these issues:
>
> 1. Add responsability for collaborating with 'IContained' to
> 'IContainer'.
+1
> 2. Move responsability for generating modification events for
> containers back to application code.
A container knows everything it needs in order to produce modification
events, so from that point of view, it should be in container code, not
application code.
Maybe we should consider "containment" to be a particular kind of
"relationship".
The answer to this could be to decide how we want to tell the world
about changes to relationships, and then make containment relationships
just one case of this.
The need to send out Events might just be a policy of the
relationships-notification system.
> 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".
Although, I admit that a view looks a bit like containment:
- A view instance is found via a particular kind of traversal
from an object.
- A view instance has only one "parent" or "container".
I guess we could have persistent view instances, although I can't think
of a good reason to want them just at the moment.
What name would you traverse on a content object to get to its views?
"@@viewname" ?
--
Steve Alexander
More information about the Zope3-dev
mailing list