[Zope3-dev] Re: Meta Data

Jim Fulton jim@zope.com
Sat, 24 May 2003 08:21:08 -0400


Garrett Smith wrote:
> Jim Fulton wrote:
> 
>>As others have suggested, I'd provide title as a data attribute and
>>use a custom DC adapter that got the title from the data, rather than
>>from annotations.
> 
> 
> What do you think of an addition to the schema framework to map a data
> element to a DC element? E.g. something to indicate that field 'foo' is
> also the DC 'title' element (or whatever). I could see two possible
> mappings: The first, a direct field to DC element mapping, whereby a
> write or read to one effected the other. The second, a read-only mapping
> that used a formula to calculate a DC element value.
 >
> I think this would encourage developers to worry first about class
> definitions and second about how to tap into the DC metadata features in
> Zope.

You are on the right track. It depends on what you mean by the "schema
framework". Schemas are purely specifications.  The statements above
are implementation statements.  There is and will be more application
framework that uses schemas. So in theory, there could be a system like
the one you suggest for specifying howe to implement a DC schema.

OTOH, this particular problem is much simpler than it appears,
I really think that "title" is the only DC property that is sometimes
meta data and sometimes data (for objects that are not, themselves,
meta-data objects). A very simple solution to this problem is to
define a DC adapter that simply delegates the title to the underlying
content.

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