[Zope-CMF] CMF 1.6
Alec Mitchell
apm13 at columbia.edu
Wed Nov 16 18:31:27 EST 2005
On Wednesday 16 November 2005 01:41 pm, Florent Guillaume wrote:
> I'd like to have some clarifications from the Plone team about what
> they expect to do w.r.t. events in CMF 1.6.
>
> I see two possibilities:
> 1. you guys are prepared to do the work needed for Plone products to
> use super() in manage_afterAdd & co, in which case I can merge my
> branch into CMF 1.6
> 2. you feel that's too dangerous and, as Plone intends to use CMF
> 1.6, I'll merge for CMF 2.0 only.
>
> Be aware that if 2. is chosen, you won't be able to use Zope 3 events
> at all with CMF 1.6.
I'm a bit worried about the potential consequences here, so I'd say #2 is
probably a necessity. Even then, using super in a such a ubiquitously
inherited class seems very dangerous. Though I'm by no means an expert on
the pitfalls of super(), my worry is that there are many products out there
that subclass CMFCatalogAware, either directly or through
BaseObject->CatalogMultiplex->CMFCatalogAware. Even if we move to using
super in BaseObject and CatalogMultiplex, we still have the problem of
subclasses of BaseObject (i.e. nearly everything in the plone universe these
days) needing to use super in any manage_after/before* methods (overriding
e.g. manage_beforeDelete and delegating back to the parent class is quite
common).
Am I misunderstanding here, or is this change going to break any 3rd party
product that uses CMFCatalogAware and overrides manage_before* without using
super()? The fix for these products would be for them to also use super and
possibly reorder their baseclasses so that the super users come first
(though according to http://fuhm.org/super-harmful/, that still may result
in unexpected behavior). This would seem unacceptable for the next point
release of Plone. If this is going into CMF 2.0, then it's yet another
reason for plone to stay clear of CMF 2.0 for a little while.
The big problem with this move is there's no way to give product developers
warning. They can't start using super now, because none of the base classes
use it, but once super is in place in the base classes developers will need
to start using it immediately or risk strange breakages. Maintaining
product compatibility between versions of CMF/Plone will become nearly
impossible. Doesn't look like there are any alternatives for getting
add/delete/copy events working under zope2 though.
Alec
More information about the Zope-CMF
mailing list