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

Steve Alexander steve@cat-box.net
Thu, 17 Jul 2003 18:33:15 +0300


> Suppose Foo had a base class.  Would there be a nonceInterface
> for the base class?

Not unless you created one for the base class.

> Would there be any relationship between
> Foo's nonce interface and the base's nonce interface?

Let's say we had this:

   class Foo:

       nonceInterface()

       f = 12

       def m(self):
          pass


   class Bar(Foo):

       nonceInterface()

       g = 13

In this case, I would expect Bar.interface to extend Foo.interface.

Now consider this case:

   class Foo:

       implements(IFoo)

       f = 12

       def m(self):
          pass


   class Bar(Foo):

       nonceInterface()

       g = 13

Here, I wold expect Bar.interface to extend IFoo.


But really, I'm not sure this should matter, because nonce interfaces 
are for using for that exact class.
One danger is that this feature will be abused as the most common way to 
write any kind of interface...

--
Steve Alexander