bridging Zope core interfaces - a small proposal
Hi! Five comes with some code that bridges Zope 2 interfaces to Zope 3 interfaces. This way Zope 2 interface definitions can be reused without adding redundant code. This is quite useful, but doesn't work for Zope core interfaces: Five depends one many Zope core packages and using Five code in these packages creates circular imports. I propose to move the Five bridging code (bridge.py, fiveconfigure.createZope2Bridge and related tests) to the Interface package of Zope 2. Five would still ship with a copy of that code for Zope 2.7 backwards compatibility. Any comments? If there are no objections, I'll check in these changes. Cheers, Yuppie
On 7/6/05, yuppie <y.2005-@wcm-solutions.de> wrote:
Five comes with some code that bridges Zope 2 interfaces to Zope 3 interfaces. This way Zope 2 interface definitions can be reused without adding redundant code.
This is quite useful, but doesn't work for Zope core interfaces: Five depends one many Zope core packages and using Five code in these packages creates circular imports.
Did I understand that correctly, it is a problem if you want to use Five *from* zope core code?
Lennart Regebro wrote:
On 7/6/05, yuppie <y.2005-@wcm-solutions.de> wrote:
Five comes with some code that bridges Zope 2 interfaces to Zope 3 interfaces. This way Zope 2 interface definitions can be reused without adding redundant code.
This is quite useful, but doesn't work for Zope core interfaces: Five depends one many Zope core packages and using Five code in these packages creates circular imports.
Did I understand that correctly, it is a problem if you want to use Five *from* zope core code?
Correct. It's not always a problem, but the bridging code doesn't depend on anything else in Five, so I guess moving that code into the core would be a clean solution. Cheers, Yuppie
On 7/6/05, yuppie <y.2005-@wcm-solutions.de> wrote:
Lennart Regebro wrote:
Did I understand that correctly, it is a problem if you want to use Five *from* zope core code?
Correct. It's not always a problem, but the bridging code doesn't depend on anything else in Five, so I guess moving that code into the core would be a clean solution.
Well, we wanna start doing that in Zope 2.9, so +1 on svn head from me I guess. :) -- Lennart Regebro, Nuxeo http://www.nuxeo.com/ CPS Content Management http://www.cps-project.org/
yuppie wrote:
I propose to move the Five bridging code (bridge.py, fiveconfigure.createZope2Bridge and related tests) to the Interface package of Zope 2. Five would still ship with a copy of that code for Zope 2.7 backwards compatibility.
Based on a suggestion from philiKON and some discussion on IRC I modify my proposal: The bridging code added to Interface should work the other way round, bridging newstyle interfaces to oldstyle interfaces. Existing Zope 2 interfaces should be converted to Zope 3 interfaces and bridged back to Zope 2 interfaces for backwards compatibility. Cheers, Yuppie
participants (2)
-
Lennart Regebro -
yuppie