[Zope3-dev] Heads up! Major interface changes coming this weekend

Jim Fulton jim@zope.com
Fri, 02 May 2003 18:26:20 -0400


This weekend, I'm going to merge a number of interface changes into the
Zope 3 head.  These changes are described in:

   http://dev.zope.org/Zope3/BetterInterfaceImplements

Note particularly the backward compatability section, Whicj I've
included below. The Zope 3 core will be updated and I'll check products
in the zopeproducts section of the repository, but other products may
need to be updated.

Jim


   Backward compatability

     Simple declarations of the form::

        class Foo:

          __implements__ = IFoo

     will not need to change. Note however that the semantics are a
     little bit different. Consider the following example::

        class A:
          __implements__ = IA

        class B:
          __implements__ = IB

        class C(A, B): pass

     Before, 'C' only implemented 'IA', but now, C implements 'IA' and
     'IB'.

     The following advanced
     declarations will need to be changed:

     - Declaration of interfaces implemented by a class itself

       Any uses of '__class_implements__' need to be changed from::

        class Foo:

          __class_implements__ = IFooFactory
          __implements__ = IFoo

       to::

        class Foo:

          classProvides(IFooFactory)
          __implements__ = IFoo

     - Declaration of interfaces implemented by a module

       Assignments to the global variable,  '__implements__' in a
       module definition need to change from:

          __implements__ = IFoo

       to::

          moduleImplements(IFoo)


     - Declaration of interfaces implemented by an object by assigning
       an '__implements__' attribute need to change from::

          myobject.__implements__ = IFoo

      to::

          directlyProvides(myobject, IFoo)


-- 
Jim Fulton           mailto:jim@zope.com       Python Powered!
CTO                  (703) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org