[Zope-dev] Re: Deprecating Zope 2 interfaces?

Philipp von Weitershausen philipp at weitershausen.de
Tue Feb 21 07:29:04 EST 2006


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


More information about the Zope-Dev mailing list