[Zope3-dev] annotations/dc and component definitions

Steve Alexander steve@cat-box.net
Wed, 23 Apr 2003 17:54:27 +0200


Garrett Smith wrote:
> I'm a bit confused about the use of annotations and component
> "definitions".
> 
> As an example, assume I want to create a system to manage a library of
> books. I create an interface IBook:
> 
>   class IBook(Interface):
>     title = TextLine(...)
>     author = TextLine(...)
>     publishDate = DateTime(...)
>     ...
> 
> Clearly there's overlap in IBook with the DC 'title' annotation. (In
> fact, there is massive overlap as book cataloging is a primary DC
> application.)

Right. We discussed this kind of issue recently, at the Bristol sprint.
There should be an easy way of saying that a particular object will take 
responsibility for part of its DC metadata.


> My questions:
> 
>  - I've noticed that several (most?) content types in Zope 3 use
> IAttributeAnnotatable to signal that they support annotation via object
> attributes. Should an interface omit a property (e.g. title,
> description, etc.) under the assumption that it will be handled via
> "metadata"? (A good example of this is the NewsSite INewsItem interface
> -- it only defines teaser and body, letting DC annotations handle the
> rest.)

Yes, if it is metadata.
No, if it is essential to the object.
For a book, 'title' is essential to the object.
I would expect a book's 'title' to be the same as its DC title.
One way to do this to to make Book implement one of the Dublin Core 
interfaces.
This is not as easy as it should be. We need to work on making this easier.

You could help by shepherding a proposal for making this kind of thing 
easier. Collecting requirements, such as the ones you list in this 
email, is a good start. Perhaps the authors of the NewsSite product have 
things to contribute too?


>  - Is there a concept of read-only annotations?

DC metadata doesn't have to come from annotations.
If you're asking "Is there a concept of read-only DC metadata?" then the 
answer is "yes".


> I suppose these questions are getting at the intended use of
> annotations. Getting more to the point:
> 
>  - Should annotations be used to implement component properties or be
> limited to "attaching" data to a component (as the term 'annotate'
> implies)? What are the guidelines here?

I think you are confusing the mechanism "annotations" with the 
requirement to have Dublin Core metadata.


>  - What happens when component properties and annotations overlap or
> collide? (I see collision being when a metadata value "is the same as" a
> component property or when a metadata value "is a function of" one or
> more component properties.)

I'd like to see a proposal that clearly lists the use-cases for this 
(I'm sure there are many compelling ones), and (eventually) spells out 
how to make this straightforward.

--
Steve Alexander