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

Garrett Smith garrett@mojave-corp.com
Fri, 18 Jul 2003 13:52:39 -0500


Jim Fulton wrote:
>> Something like this:
>>=20
>>  <class class=3D"Foo">
>>    <implements interface=3D"IFoo"  auto_generate=3D"True" />  =
</class>
>>=20
>> would cause an interface "IFoo" to be created and registered --
>> perhaps including public methods and attributes of Foo.
>=20
> This is the nonce interface again. What is the point? What does it
> gain us?
>=20
> Jim

Yeah, I suppose I was thinking of something more like:

<class class=3D"Foo" auto_interface=3D"IFoo">
    <method name=3D"bar" permission=3D"..." >
        <contract args=3D"x y=3DNone">
            Returns such and such.
        </contract>
    </method>
</class>

This does look pretty silly, but I'm trying to leverage the fact that
developers have to define security for their classes anyway. Is there
some way to work the 'public contract' aspect of an interface into this
process?

The silly example no doubt detracts from the spirit of the suggestion,
which is to move the Zope 3 specific requirements (like security) into
ZCML.

And maybe I'm trying too hard to help solve a problem that I don't
believe is really a problem :-)

 -- Garrett