[Zope3-dev] Allowing views to be registered for classes ratherthaninterfaces.
Jim Fulton
jim@zope.com
Fri, 18 Jul 2003 14:25:34 -0400
Garrett Smith wrote:
> Jim Fulton wrote:
>
>>Subject: Re: [Zope3-dev] Allowing views to be registered for classes
>>ratherthaninterfaces.
>>
>>
>>Garrett Smith wrote:
>>
>>...
>>
>>
>>>Developers have to go through ZCML to define class permissions. What
>>>about an option, in the content or class directives, to define an
>>>implicit interface -- like a macro. I'm not sure what this would look
>>>like...an 'interface' or 'schema' or multiple 'method/attribute'
>>>subdirectives.
>>>
>>>This could serve the primary purpose, if I understand Jim's main
>>>concern, for explicit contract definition. It would also ensure that
>>>an interface and class were always in sync, eliminating the tedium
>>>that Martijn mentioned in an earlier message.
>>>
>>>This is also a common Zope 3 pattern -- supporting certain
>>>definition/registration tasks in ZCML that would otherwise be
>>>required in Python.
>>
>>I can't figure out what you are suggesting here.
>
>
> Something like this:
>
> <class class="Foo">
> <implements interface="IFoo" auto_generate="True" />
> </class>
>
> would cause an interface "IFoo" to be created and registered -- perhaps
> including public methods and attributes of Foo.
This is the nonce interface again. What is the point? What does it
gain us?
Jim
--
Jim Fulton mailto:jim@zope.com Python Powered!
CTO (703) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org