[Zope3-dev] Re: Properties?

Jim Fulton jim@zope.com
Tue, 13 May 2003 10:05:51 -0400


Martijn Faassen wrote:
> Jim Fulton wrote:
> [snip]
> 
>>I should have noted that I've been thinking of defining a site
>>properties service.  This would be used for site configuration
>>parameters. It would be a separate object that could be synchromized
>>independently.
>>
>>I see sontent properties to be more about one-off instances that about
>>site configuration.  It might be, though, that people will prototype
>>with regular proprties and then later turn some of these into site
>>properties.
> 
> 
> But how would you use such a one-off instance that's not site-configuration?

You use it when you want a new kind of object, but you only need one
and you don't want to bother with the CA, because you only need one. :)


...


> In Zope 2, content-space properties are more useful as they're easily
> acquired. Some other code (view code, in particular, I suspect) picks up these 
> properties and changes behavior based on it. Something like 'background color' 
> would be an example of this.

I thyink that Zope 3 properties might be easily acquirable too.  If we do this,
then part of it will be to come up with an easy to use API using acquired properties.

> There's an overlap with metadata, so I'm not sure whether a separate
> concept is needed -- it could just be some other metadata schema attached
> to Folders.

Implementationwise, there is overlap.  I don't think people tyically think of these
as meta data.  Think in terms of creating a new kind of object that is a singleton.

> Another use case would be the case of dynamic content. A page template or
> a Python function needs to be configurable in some simple way, so that
> people can tweak its behavior without having to change the code completely.
> A property could be used here, but I'd question whether it would need
> to be on the folder at all -- why not on the dynamic content itself?

Perhaps.  Have people *actually* used properties this way. This might require
more sophistication than is justified by the benefit. After all, you could always
just define some parameters at the top of the code.

Jim

-- 
Jim Fulton           mailto:jim@zope.com       Python Powered!
CTO                  (703) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org