yuppie wrote:
4.) Making interfaces.zcml point to the new locations. [Five 1.0+]

5.) Adding unit tests that verify interfaces and implementations. [Zope 2.8.0]

IMHO that's yagni. We actually don't use interfaces that much for verifying implementations anymore. I think their most common use in Zope 3/Five is documentation, API/schema specification, and easier spelling for security declarations.


Who is 'we'?

The Zope 3 developers.

How do you make sure documentation and specification are in sync with the implementation? AFAICT verifyClass() is quite useful for that.

Your unit test should exercise the whole API promised by an implementation anyway, so often an explicit interface check is redudant (of course, it can't hurt). verifyClass() per se isn't bad, it's in fact a useful indicator, but having that it as a *sole* measure whether a class fulfills an interface or not is not sufficient (plus, in many Zope cases, verifyObject is better because attributes may only be initialized in __init__).

The point why I think it's YAGNI is that we know the Zope 2 implementations do implement the interfaces. After all, I derived the interfaces from the implementations by gutting out the code. And it's unlikely they'll change (although I might be wrong on this one, in which case you win :)).

Zope-Dev maillist - Zope-Dev@zope.org
** No cross posts or HTML encoding! **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )

Reply via email to