[Zope3-dev] Meta Data

Jim Fulton jim@zope.com
Mon, 19 May 2003 11:19:48 -0400


Garrett Smith wrote:
> Jim Fulton wrote:
> 
>>>I think the confusion stems from the fact that implementing
>>>IAttributeAnnotatable enables metadata for content. Without tracing
>>>down the linkages, this seems like a bit of magic.
>>
>>Agreed.  And I can understand why some feel this is a wart.
> 
> 
> Personally, I don't think developers are going to sweat this.
>  
> 
>>Data the object manages is regular data. Meta data is data about the
>>object. By (my) definition, if an object manages data, it isn't meta
>>data, it's data. (Allowing an __annotations__ attribute doesn't
>>constitute management.) If the implementation of an object refers to
>>some data, the data is not meta data.
> 
> 
> This is what I would expect. But I think the current content
> implementations will lead developers down the road for using metadata
> when they should use data. E.g. the news item implementation -- title,
> description, etc. are implemented using metadata when I think, per your
> standards, they should be implemented using data. (Not a critique, just
> trying to flush out a key design issue.)

In this casem title is data. Not so sure about description, etc.


>>Meta data will most often be implemented using annotations, since
>>annotations were invented for this purpose.
> 
> 
> How would you handle the DC metadata 'title' element for a book, which
> clearly has a title data element that it will manage? I would expect
> that changing the metadata title value would also update the book title
> property, and vise versa.

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.

> This pattern could be applied to news item as a model, unless I'm
> smoking something here.

Right.

> And one more, slightly more esoteric example/question: What about
> something like "Person" content where the DC 'title' element might be a
> function of the person's first and last name, e.g. "Mr. Jim Fulton".
> Here it seems like we may be dealing with a read-only DC 'title'.

Yes.

Note that the ambiguity of DC "title" contributes to the ambiguity here.
Do people have "titles"? Do they have more than one?  DC allows many different
titles.

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