[Zope-dev] relocating Zope 2 core interfaces - a proposal
yuppie
y.2005- at wcm-solutions.de
Fri May 6 07:07:03 EDT 2005
Hi again!
As discussed two days ago, I started working on integrating Five
interfaces closer into Zope 2.8. I believe I understand the problem
better now and like to propose a different way to resolve it:
Current State
=============
Five (now part of Zope 2.8) ships with one big interfaces.py file that
contains z3 interfaces for Zope 2 core classes. (There are also some
five specific interfaces in that file, but they are not subject of this
proposal.)
interfaces.zcml states that Zope 2 implements these interfaces, but
there are no tests to verify that and in fact many of these interfaces
are broken in Five 1.0. (Yesterday I checked in some fixes to the Five
trunk.) So if they are used at all in Five products, they are only used
as marker interfaces, not to verify implementations.
I grepped through CMFonFive, SilvaDocBook and SilvaFlexibleXML: None of
them use these interfaces.
Goals
=====
Step by step, Zope 2 should move to z3 interfaces. Where z2 interfaces
exist, these should be improved and bridged to z3 interfaces. Missing
interfaces should be added as z3 interfaces. Instead of maintaining
competing interfaces, Five should support that process.
Interface locations are identifiers, so first of all I want to get these
locations right before Zope 2.8 is released. Z3 interfaces should be
located in an 'interfaces' module of the corresponding package. In the
Five package they are unmaintainable.
So e.g. instead of
Products.Five.interfaces.IObjectManager
Products.Five.interfaces.IWriteLock
we would have
OFS.interfaces.IObjectManager
webdav.interfaces.IWriteLock
Proposed Solution
=================
1.) Adding ZCML that bridges existing z2 interfaces into the
'interfaces' module of their package. [Zope 2.8.0]
2.) Copying z3 interfaces from Five.interfaces to the 'interfaces'
module of the corresponding package. Marking those in Five as Zope 2.7
backwards compatibility cruft. [Zope 2.8.0]
3.) Doing the same for Zope 2.7 with monkey patching code. [Five 1.0+]
4.) Making interfaces.zcml point to the new locations. [Five 1.0+]
5.) Adding unit tests that verify interfaces and implementations. [Zope
2.8.0]
Risks
=====
I can't see a way to provide backwards compatibility for
Products.Five.interfaces.*, but as explained above I'm hopeful this
doesn't break many Five products.
Any comments?
Cheers,
Yuppie
More information about the Zope-Dev
mailing list