yuppie wrote:

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.)

Note that they also need to be in the 1.0 branch, if this is to be in Zope 2.8.

So if they are used at all in Five products, they are only used as marker interfaces, not to verify implementations.

True; Five hasn't worked with verifying implementations at all yet as far as I know.

I grepped through CMFonFive, SilvaDocBook and SilvaFlexibleXML: None of them use these interfaces.

I think there's some code inside the Five tests that might use them. There's also a chance someone else is using them, but admittedly the risk of breaking something doesn't seem too big. This does deserve to be called 1.1 though if we're breaking APIs (this would then derive from the 1.0 branch, not the Five trunk).


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.

[snip example]

Agreed again.

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+]

I don't understand this step; what are you proposing?

4.) Making interfaces.zcml point to the new locations. [Five 1.0+]

While in Zope 2.8, we could add 'implements' in the Zope 2 code directly, we don't need to do this from ZCML anymore.

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.

I'm okay with giving up backwards compatibility here.

Another potential risk is Five doing five:implements to a class that already has a Zope 3 style 'implements()'. I don't know what happens in such a case...


Zope-Dev maillist - Zope-Dev@zope.org
** No cross posts or HTML encoding! **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )

Reply via email to