[Zope3-dev] adaptation based on class rather than interface

Dieter Maurer dieter at handshake.de
Thu Nov 9 14:51:45 EST 2006


Martin Aspeli wrote at 2006-11-9 04:37 -0800:
> ...
>Why does your class not have a (non-marker) interface in the first place?
>The use of interfaces as documentation and as formalisms for expressing a
>class' functionality (in adapters, utilities etc) is one of the benefits
>that Zope 3 introduces. I can see how they may not always add that much
>value immediately, but they are a good way of ensuring things are reasonably
>well-defined, well-documented and easily locatable.

I have quite a different point of view:

  Interfaces define essentially the signature of methods but
  these signatures can also directly be derived from the class.

  Zope3 interfaces are slightly better as they can also specify
  attributes -- which is very helpful as Python does not
  provide a good means for this.




-- 
Dieter


More information about the Zope3-dev mailing list