[Zope] Using Zclasses
Michael Bernstein
mbernstein@profitscape.net
Tue, 06 Jul 1999 13:06:05 -0700
Michel Pelletier wrote:
>
> Michael Bernstein wrote:
> >
> > Alexander Staubo wrote:
> > >
> > > Your second question is trickier, because Zope does not,
> > > afaik, support
> > > properties that are objects. It's possible, but I believe
> > > you can't edit
> > > these properties through the standard management
> > > interfaces. Instead,
> > > you must built your own, and you might have to use Python
> > > to store these
> > > properties.
> >
> > Hmm, seems a pretty important feature, does anyone know if
> > this sort of
> > functionality is on the drawing board for the Zope interface?
> >
>
> Currently, Properties offer the only way to have assignable attributes
> in DTML, so it is possible to instanciate an object and assign it to a
> property. You would most likely get errors if you tried to manage that
> property through the managment interface, but otherwise it would behave
> as expected.
The sort of thing I want to do, is create a property in a ZClass that
will contain a pointer to an instance of some other ZClass of a
particular metatype.
For example: A Book ZCLass that has an Author property that points to an
instance of an Author ZClass. The Author should have ordinary properties
taht are accessible as subproperties of the Book instance. So that when
displaying the book, I should be able to insert a <!--#var
Author.name--> and get the expected result.
The problem with containing the Author within the Book, is that this
does not allow for many-to-many relationships without a lot of
redundancy. As I understand it, the chief benefit ODBMSs have over
RDBMSs is that expensive SQL joins are replaced by (computationaly
speaking)cheap pointer lookups. I really think that ZOPE would benefit
from this capability. It would also alleviate the biggest problem I have
with the interface which is the constraint to a singly rooted exact
heirarchy.
Perhaps I'm barking up the wrong tree here. Can ZCatalogs help with this
sort of situation? my actual model will probably have over a dozen
object types.
Michael Bernstein.