[Zope3-dev] Properties?

Paul Winkler pw_lists@slinkp.com
Mon, 12 May 2003 07:15:39 -0400


On Mon, May 12, 2003 at 10:37:07AM -0400, Jim Fulton wrote:
> Zope 2 has a simple mechanism for extending the schema of many
> standard objects, especially folders, with properties.  Properties
> defined on folders and other objects provide additional attributes.
> This makes properties easy to access.  This model has provided a
> number of advantages:
> 
> - It has enabled the use of folders and documents as one-off
>   isntances.
> 
> - It, together with acquisition, has made it easy to define and share
>   simple variables/configuration data.
>
> I think that this model has been pretty sucessful.

yes, for the most part.  it's certainly useful. 
Folder properties are often used for
configuration - see e.g. the skins tool in zope 2 CMF.

But that leads me to a problem I have with this model.
You can't back up, or sync to another zope, your properties-
based configuration independently of the ENTIRE folder contents. 
This is very inconvenient, and it just smells wrong. To take a 
real-world example: on a CMF site i maintain, every time the company
adds a new customer they create a new skin path. We'd really
like to be able to sync the new skin paths to a production server
without syncing the entire skins tree, which often contains 
stuff that's in development and not completely working yet.
Since we can't do that, we have to duplicate the developement
skin paths on the production server by hand. This process is
error-prone.

I've even thought of addign a "sync properties only" feature
to zsyncer, but i have no idea how i'd implement it.
It would probably be very hacky.

What if instead we had properties stored in independent objects
within the folder?  Maybe there could be a PropertyHolder 
class, and if you ask a folder for its properties, 
it acquires them from all PropertyHolders that it contains.

hm. problem with this model: what if multiple PropertyHolders are
instantiated in a folder and define a property with the same name? 
Yuck.  So maybe we'd have to have a "1 PropertyHolder per
folder" rule? similar to the use of acl_users?

-- 

Paul Winkler
home:  http://www.slinkp.com
"Muppet Labs, where the future is made - today!"