[Zope3-dev] Allowing views to be registered for classes rather than interfaces.

Phillip J. Eby pje@telecommunity.com
Fri, 18 Jul 2003 12:50:08 -0400


At 06:42 PM 7/18/03 +0200, Martijn Faassen wrote:
>Steve Alexander wrote:
>[why not views for classes instead? what advantages does nonceInterface have?]
> > Only that you can migrate slowly to using schema by specifying just the
> > fields you require.
>
>I think there's also something in the purity of the design; we don't
>need to mess around with a lot of possibly complicated machinery
>involving lookup registries and the like if we introduce just an interface.
>We also avoid the confusion that may occur when we say "interfaces can
>be to classes, to interfaces" and you get "what's the difference? why should I
>ever use interfaces?".

Indeed.  :)

Conceptually speaking, to assert that a class (or object) implements an 
interface, is the same thing as saying that it may be adapted to that 
interface via a "null adapter".

Thus, I disagree that explicit nonce interfaces are a "pure" design.  To 
me, the pure design would be allowing adaptation from anything to anything 
(as PyProtocols does).

Arguably, this is also more conceptually compatible with interfaces in 
other languages, where there is not nearly so sharp a line drawn between 
classes and interfaces as in Zope.