Re: [Zope3-dev] Multi Interface Types Registration
Stephan Richter wrote: IMO multi-typed interfaces would make sense. Would you have any objections if I change the code the following way: module: zope.app.component.interface.py, line 78 75if iface_type is not None: 76if not iface_type.extends(IInterface): 77raise TypeError(iface_type, "is not an interface type") 78directlyProvides(interface, iface_type, directlyProvidedBy(interface)) I would like to see a use case first. Once we can agree that the use case is really necessary, this change will be fine. It's not just a matter of use case, it's also a matter of potentially unintended misconfiguration and side effects: The directly-provide-implementation decision allows multi-typed interfaces on python level. As soon the interface directive is invoked manipulation on python level will be 'removed' by a single type information. Such behavior complicates the live of developer knowing the interface package only. Use case: Typing interfaces within orthogonal application domains: -> CMS-Domain -> IContentType, IEventType, ... -> Business-Domain -> IAnyBusinessDomainType Regards, Dominik ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
Re: [Zope3-dev] Multi Interface Types Registration
Dominik Huber wrote: Hi Stephan, Is there a specific reason why only one interface type is directly provided per interface? If two types are registered for one interface the first type is chucked out of the interface during the registration of the second, but the first stays still registered within the utitlity service. Bug or Feature? IMO multi-typed interfaces would make sense. Would you have any objections if I change the code the following way: module: zope.app.component.interface.py, line 78 75if iface_type is not None: 76if not iface_type.extends(IInterface): 77raise TypeError(iface_type, "is not an interface type") 78directlyProvides(interface, iface_type, directlyProvidedBy(interface)) +1 -- Jim Fulton mailto:[EMAIL PROTECTED] Python Powered! CTO (540) 361-1714http://www.python.org Zope Corporation http://www.zope.com http://www.zope.org ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
Re: [Zope3-dev] Multi Interface Types Registration
On Monday 25 April 2005 07:26, Dominik Huber wrote: > Is there a specific reason why only one interface type is directly > provided per interface? > If two types are registered for one interface the first type is chucked > out of the interface during the registration of the second, Right. > but the first stays still registered within the utitlity service. Yep, that's ok. > Bug or Feature? Feature. When we originally wrote this code, it did not make sense for an interface to have several types. > IMO multi-typed interfaces would make sense. Would you have any > objections if I change the code the following way: > > module: zope.app.component.interface.py, line 78 > 75 if iface_type is not None: > 76 if not iface_type.extends(IInterface): > 77 raise TypeError(iface_type, "is not an interface type") > 78 directlyProvides(interface, iface_type, > directlyProvidedBy(interface)) I would like to see a use case first. Once we can agree that the use case is really necessary, this change will be fine. Regards, Stephan -- Stephan Richter CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student) Web2k - Web Software Design, Development and Training ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com
[Zope3-dev] Multi Interface Types Registration
Hi Stephan, Is there a specific reason why only one interface type is directly provided per interface? If two types are registered for one interface the first type is chucked out of the interface during the registration of the second, but the first stays still registered within the utitlity service. Bug or Feature? IMO multi-typed interfaces would make sense. Would you have any objections if I change the code the following way: module: zope.app.component.interface.py, line 78 75if iface_type is not None: 76if not iface_type.extends(IInterface): 77raise TypeError(iface_type, "is not an interface type") 78directlyProvides(interface, iface_type, directlyProvidedBy(interface)) Regards, Dominik ___ Zope3-dev mailing list Zope3-dev@zope.org Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com