[Zope3-Users] Properties of content components as containers.
Alec Munro
alecmunro at gmail.com
Mon Jul 25 13:22:24 EDT 2005
Hi List,
I've been going over this for a while, and while I think I understand
how it could work, I would really like some advice on how it should
work.
I have a content component that can contain a couple other types of
content component. The way I had originally thought to implement this
was to have a property of the content component for each type, and
have that property be a container for that type. I have very little
idea how to implement this.
Once I got to thinking about implementation, two scenarios emerged:
The first one is a relatively small departure from the above, where
the content components of each type are added directly to the primary
component, and the __setitem__ method on the primary component checks
their type, and calls __setitem__ on the appropriate property.
The other scenario was that the primary component would actually store
all of the added components itself, and I would provide adapters to
the primary component for that type.
Writing it out, it seems like the second method is probably the more
correct one, but I would appreciate people's opinions, as I have much
to learn.
Alec
More information about the Zope3-users
mailing list