Deprecating Zope 2 interfaces?
Hi there, I don't think it will make much sense to keep Zope 2 interfaces around for more than one year from now. In other words, I'm suggesting to deprecate them for Zope 2.10. There are a few places in Zope 2 where they are still used for checks (mostly webdav, OFS, ZCTextIndex). For the deprecation period, these checks will have to be done against both the Zope 2 and the Zope 3 interface. I think this is as hard as it gets for the switch-over to Zope 3 interfaces, but perhaps I'm missing something. Philipp
Hi Philipp! Philipp von Weitershausen wrote:
I don't think it will make much sense to keep Zope 2 interfaces around for more than one year from now. In other words, I'm suggesting to deprecate them for Zope 2.10.
+10 But we can't deprecate z2 interfaces as long as Zope 2 itself uses them for other tasks than providing backwards compatibility. There are still some unconverted z2 interfaces in Zope 2.
There are a few places in Zope 2 where they are still used for checks (mostly webdav, OFS, ZCTextIndex).
In detail these are: 1.) WriteLock: Objects are only lockable if their class has WriteLockInterface in its __implements__ list. 2.) PluggableIndex: Indexes for ZCatalog have to be registered in Products.meta_types with PluggableIndexInterface. 3.) IFAwareObjectManager and the 'interfaces' argument of ObjectManager.all_meta_types: The mechanism used for pluggable indexes has a generic implementation in ObjectManager and can be used by any subclass of IFAwareObjectManager.
For the deprecation period, these checks will have to be done against both the Zope 2 and the Zope 3 interface.
In Zope 2.9 these mechanisms already work alternatively with z3 interfaces. There should be no need to use z2 interfaces in products written for Zope 2.9.
I think this is as hard as it gets for the switch-over to Zope 3 interfaces, but perhaps I'm missing something.
Don't think so. But there might be other z2 interfaces in use. Cheers, Yuppie
yuppie wrote:
I don't think it will make much sense to keep Zope 2 interfaces around for more than one year from now. In other words, I'm suggesting to deprecate them for Zope 2.10.
+10
But we can't deprecate z2 interfaces as long as Zope 2 itself uses them for other tasks than providing backwards compatibility. There are still some unconverted z2 interfaces in Zope 2.
Right. These would have to be converted before or at the same time we introduce the deprecation.
There are a few places in Zope 2 where they are still used for checks (mostly webdav, OFS, ZCTextIndex).
In detail these are:
1.) WriteLock: Objects are only lockable if their class has WriteLockInterface in its __implements__ list.
OFS.PropertySheets also does this.
2.) PluggableIndex: Indexes for ZCatalog have to be registered in Products.meta_types with PluggableIndexInterface.
3.) IFAwareObjectManager and the 'interfaces' argument of ObjectManager.all_meta_types: The mechanism used for pluggable indexes has a generic implementation in ObjectManager and can be used by any subclass of IFAwareObjectManager.
Thanks for tracking those down. According to a search for 'isImplementedBy' (the old interface API method), there's also: 4) OFS.DTMLMethod and ZPublisher.HTTPResponse check for IStreamIterator 5) Products.Trancience checks for TransientItemContainer (no leading I) We should put #BBB comments to all of those locations so we won't forget.
For the deprecation period, these checks will have to be done against both the Zope 2 and the Zope 3 interface.
In Zope 2.9 these mechanisms already work alternatively with z3 interfaces.
Not all of them but most of them.
I think this is as hard as it gets for the switch-over to Zope 3 interfaces, but perhaps I'm missing something.
Don't think so. But there might be other z2 interfaces in use.
Sure, which is why we have the deprecation period for 12 months after the Zope 2.10 release so that 3rd party software has time to switch. Though I believe that most of the big projects have already switched their interfaces to Zope 3 ones, only keeping the old ones for backward-compat. Philipp
Hi Philipp! Philipp von Weitershausen wrote:
yuppie wrote:
There are a few places in Zope 2 where they are still used for checks (mostly webdav, OFS, ZCTextIndex). In detail these are:
1.) WriteLock: Objects are only lockable if their class has WriteLockInterface in its __implements__ list.
OFS.PropertySheets also does this.
2.) PluggableIndex: Indexes for ZCatalog have to be registered in Products.meta_types with PluggableIndexInterface.
3.) IFAwareObjectManager and the 'interfaces' argument of ObjectManager.all_meta_types: The mechanism used for pluggable indexes has a generic implementation in ObjectManager and can be used by any subclass of IFAwareObjectManager.
Thanks for tracking those down. According to a search for 'isImplementedBy' (the old interface API method), there's also:
4) OFS.DTMLMethod and ZPublisher.HTTPResponse check for IStreamIterator
5) Products.Trancience checks for TransientItemContainer (no leading I)
We should put #BBB comments to all of those locations so we won't forget.
Well. All those locations import z2 interfaces so it should be quite easy to find them as soon as the z2 interfaces are removed.
For the deprecation period, these checks will have to be done against both the Zope 2 and the Zope 3 interface. In Zope 2.9 these mechanisms already work alternatively with z3 interfaces.
Not all of them but most of them.
I just meant those 3 mechanisms on my list. 4) and 5) are not migrated, but there should not be many third party products that depend on them.
I think this is as hard as it gets for the switch-over to Zope 3 interfaces, but perhaps I'm missing something. Don't think so. But there might be other z2 interfaces in use.
Sure, which is why we have the deprecation period for 12 months after the Zope 2.10 release so that 3rd party software has time to switch.
Sure. I meant in use in Zope 2 itself. But your search for 'isImplementedBy' should have revealed most of them.
Though I believe that most of the big projects have already switched their interfaces to Zope 3 ones, only keeping the old ones for backward-compat.
Zope 2.8 compatible products still have to use WriteLockInterface and z2 interfaces for IFAwareObjectManager. Cheers, Yuppie
yuppie wrote:
Philipp von Weitershausen wrote:
I don't think it will make much sense to keep Zope 2 interfaces around for more than one year from now. In other words, I'm suggesting to deprecate them for Zope 2.10.
+10
Me too ;-)
1.) WriteLock: Objects are only lockable if their class has WriteLockInterface in its __implements__ list.
2.) PluggableIndex: Indexes for ZCatalog have to be registered in Products.meta_types with PluggableIndexInterface.
3.) IFAwareObjectManager and the 'interfaces' argument of ObjectManager.all_meta_types: The mechanism used for pluggable indexes has a generic implementation in ObjectManager and can be used by any subclass of IFAwareObjectManager.
I think these can safely swapped... ie: no non-zope-core code actually does anything with these interfaces... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
Chris Withers wrote:
yuppie wrote:
Philipp von Weitershausen wrote:
I don't think it will make much sense to keep Zope 2 interfaces around for more than one year from now. In other words, I'm suggesting to deprecate them for Zope 2.10.
+10
Me too ;-)
Great. There don't seem to be any objections, they would have been communicated by now otherwise. I take the silence so far as assent or indifference. All in all it means I think we can go a head and really do deprecate Zope 2 interfaces.
1.) WriteLock: Objects are only lockable if their class has WriteLockInterface in its __implements__ list.
2.) PluggableIndex: Indexes for ZCatalog have to be registered in Products.meta_types with PluggableIndexInterface.
3.) IFAwareObjectManager and the 'interfaces' argument of ObjectManager.all_meta_types: The mechanism used for pluggable indexes has a generic implementation in ObjectManager and can be used by any subclass of IFAwareObjectManager.
I think these can safely swapped... ie: no non-zope-core code actually does anything with these interfaces...
That's a bold assumption. I'm not willing to take the risk, especially if the BBB-aware code is pretty straight-forward. Philipp
Philipp von Weitershausen wrote:
That's a bold assumption.
It's a bold assumption based on the fact that I'm pretty sure there's about 1 person on the planet who's ever used that code. I believe his name's Andreas. I might be wrong of course, but I don't think it's much more than that...
I'm not willing to take the risk, especially if the BBB-aware code is pretty straight-forward.
Fair enough, as long at the BBB code doesn't smell funny ;-) Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
Chris Withers wrote:
Philipp von Weitershausen wrote:
That's a bold assumption.
It's a bold assumption based on the fact that I'm pretty sure there's about 1 person on the planet who's ever used that code. I believe his name's Andreas. I might be wrong of course, but I don't think it's much more than that...
I guess you are just talking about IFAwareObjectManager, not about WriteLockInterface and PluggableIndexInterface. You might want to grep through CMF 1.6 or CMF 2.0 to adjust your assumptions. IFAwareObjectManager is used in several places. Cheers, Yuppie
yuppie wrote:
Chris Withers wrote:
Philipp von Weitershausen wrote:
That's a bold assumption.
It's a bold assumption based on the fact that I'm pretty sure there's about 1 person on the planet who's ever used that code. I believe his name's Andreas. I might be wrong of course, but I don't think it's much more than that...
I guess you are just talking about IFAwareObjectManager, not about WriteLockInterface and PluggableIndexInterface.
You might want to grep through CMF 1.6 or CMF 2.0 to adjust your assumptions. IFAwareObjectManager is used in several places.
Yep, and building on CMF, CPS 3.4 now uses it too (with Zope 3 interfaces of course). Florent -- Florent Guillaume, Nuxeo (Paris, France) Director of R&D +33 1 40 33 71 59 http://nuxeo.com fg@nuxeo.com
participants (4)
-
Chris Withers -
Florent Guillaume -
Philipp von Weitershausen -
yuppie