[Zope3-dev] Usage of IAnnotations disrespects interface declaration

Christian Theune ct at gocept.com
Tue Dec 19 16:55:18 EST 2006


Hi,

Christian Theune wrote:
> Issue 735 (http://www.zope.org/Collectors/Zope3-dev/735) describes a
> problem how IAnnotations are used within Zope.
>
> I agree that this should be changed. I'd like to get some discussion on
> the mailinglist on how to change this (I've added a short analysis in
> the transcript of the issue).

I wanted to catch up on this. Thanks for the input!

I've considered the options everybody gave me and have also been trying
to find some pointers to how other people handle the evolution of
interfaces and found an interesting read from the "java guys":

http://wiki.eclipse.org/index.php/Evolving_Java-based_APIs

I've considered the options written in there, which is basically that
adding new required methods to an API class causes breakage.

However, in the end, I found this section:
http://wiki.eclipse.org/index.php/Evolving_Java-based_APIs#Defective_API_Specifications

I've stepped back again and looked at the interface and thought about
rewriting the code places specified in issue 735 and saw that there is
no way to it.

I hereby propose to consider zope.annotation.interfaces.IAnnotations
underspecified and therefore defective. It is intended to be used
dictionary-like, and some clients already expected it to be a
dictionary. However, we do not offer any access to the typical methods
that allow clients to get a list of keys or values.

If the IAnnotations API is decided to be underspecified and therefore
defective I argue that we can justify breakage and add the required
methods to IAnnotations.

However, in this case we should notify new users, maybe with an
easy-to-find hint in the CHANGES.txt and maybe the release messages.

Christian

-- 
gocept gmbh & co. kg - forsterstraße 29 - 06112 halle/saale - germany
www.gocept.com - ct at gocept.com - phone +49 345 122 9889 7 -
fax +49 345 122 9889 1 - zope and plone consulting and development


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://mail.zope.org/pipermail/zope3-dev/attachments/20061219/3b738324/signature.bin


More information about the Zope3-dev mailing list