[Zope-dev] Adding your own (complex) data types to property p ages: example and problems...nd problems...

Mike Fletcher mfletch@tpresence.com
Fri, 5 May 2000 04:17:48 -0400


Apparently I wasn't very clear.  My intention was to develop this in Python
(I've created a grand total of 1 ZClass so far in my life, and that was
solely to figure out how to add properties to my python code :) ). Note: I
already implemented everything I need personally as a Python module and went
on with my work :) .

In reading the interfaces Wiki, it seems as though there is an artificial
distinction between PropertyManager and PropertySheet-based objects.  For
instance, my current project has defined a PropertyManager-like interface
base class using the PropertySheet interfaces, so that from that base class
either mechanism can be used.

From this point, it is a fairly trivial idea to consider replacing the
original PropertyManager mechanism with a PropertySheets-based mechanism
(keeping the same interface and semantics as PropertyManager) (the advantage
to this is to allow all PropertyManager objects to use the more advanced
property types and support mechanisms, while reducing the total amount of
code).  The question of how to implement/re-implement PropertySheets, seems
to be the most important one.

A global registry works, but is limited.  Allowing for simple sub-classing
of PropertySheets and using, for instance, attribute lookup on the
individual PropertySheet would work, and allows for locally relevant data
types, customised input for individual sheet types etc. The problem with
this approach is that the workings of the PropertySheet class have suddenly
become something which must be understood to work with custom data types
(that is, one more piece of information to add to the Zen of Zope (this is,
compared to the total Zen, not huge, but the mental load of grokking Zope is
already quite high)).

RIPP looks capable, but is currently very young, and will not likely support
creating a PropertyManager/PropertySheet interface.  This is probably "the
future", but is not likely to support "the past".

Incidentally, knowing about the Wiki would have been a great help these last
few months.  Why is the interfaces Wiki table of contents not linked
directly off the documentation page? And why are Wiki's not indexed (do a
search on www.zope.org for PropertyManager and you only come up with one
reference). Sure, indexing a Wiki might be intensive, but the information
is, well, important :) .

I will consider creating a new Wiki, though I am rather short of time (too
long spent spelunking the depths of Zope).  It might be simpler to provide
another implementation (using PropertySheet attribute look up instead of a
global registry) and solicit comments on that.

Enjoy yourself,
Mike

-----Original Message-----
From: Michel Pelletier [mailto:michel@digicool.com]
Sent: Thursday, May 04, 2000 11:21 PM
To: Mike Fletcher
Cc: Zope Development (E-mail)
Subject: Re: [Zope-dev] Adding your own (complex) data types to property
pages: example and problems...nd problems...

...
I think it would be better to develop objects like this in Python. 
There is no clear benefit to using ZClasses for this.  There is a clear
benefit in using a ZClass to provide a user interface and subclasses a
very specialized Python class that does all the heavy lifting.
...
Doing this right would require some deep discussion.  I suggest creating
a Wiki on the zope site and soliciting comments.  You may want to review
the Interfaces Wiki first, particulary some very recent documentation
written by Brian Lloyd.

http://www.zope.org/Members/michel/Projects/Interfaces/Properties

Let us know how useful this documentation is for you.

-Michel