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

Ken Manheimer klm@zope.com
Fri, 18 Jul 2003 14:31:56 -0400 (EDT)


On Thu, 17 Jul 2003, Garrett Smith wrote:

> Steve Alexander wrote:
> > Why nonceInterface()? It is like a "nonce word".
> 
> >    For the nonce, OE. for the nones, a
> >       corruption of for then ones, where n. in then is a relic of
> >       AS. m in [eth]am, dat. of the article and demonstrative
> >       pronoun, E. the.
> 
> So, my question is, which is more tedious:
> 
> 1 - Understanding the above definition of 'nonce' (whaaaa?)
> 
> 2 - Typing:
> 
>   class IFoo(Interface):
>      """Public contract of Foo -- XXX under development."""

I think this is a good way to frame the question.

It points out to me that there is a big conceptual discontinuity
between using the ad-hoc (nonce) interface and then shifting to an
explicit interface.  There is no such jump when you start with an
explicit but unelaborated (at the extreme, marker) interface.  This
seems to me to be a big advantage of being explicit up-front - there's
not these two different situations you need to know about.

I do like that the adhoc ("nonce") interface means you can reduce the
number of artifacts you need to create for the hookup.  That doesn't
outweigh the advantage i see in reducing the number of alternative
ways to do it by always using an explicit interface.

The only other drawback i see to using an unelaborated but explicit
interface is neglect - it may be too easy to fail to elaborate it when
it's time.  That said, i'm not sure it's a problem.  It seems like you
only need to elaborate it as much as serves your purposes - whether
those are for solidifying the public contract or expressing schema
features or whatever.

So i'm, personally, pretty solidly in favor of the explicit interface.
I'd be willing to give the adhoc interface a try, if there's some kind
of deliberate attention to identifying potential pitfalls (along the
lines of newbie confusion making the switch from adhoc to explicit
interfaces) and assessing whether the pitfalls occur.

-- 
Ken
klm@zope.com