[Zope3-dev] Zope3 magic makes me cranky.

Garrett Smith garrett@mojave-corp.com
Mon, 14 Jul 2003 11:31:18 -0500


Fred L. Drake, Jr. wrote:=20
> I'd certainly prefer to see a normal factory involved, though I think
> what's happening in the <page> directive is this:  The class attribute
> of the directive can specify a class which may not inherit from one of
> the page view classes (or implement the right interface), in which
> case it is mixed-in with a common classes that implements all the
> basic stuff.  This is inherantly asking for a disaster, I think.
>=20
> But I think this was something that Jim wanted to support easier
> entrance to using Zope 3.  If we can convince him that this is
> misguided, that would be a good thing, and would allow a lot of
> simplification in this case.  And we wouldn't need such magically
> incanted classes.

Doesn't this mixin magic occur for all browser views? E.g. the
'editform' directive makes sure EditForm is mixed into the class
specified by 'class' (seems to anyway). While this is a bit subtle, it's
better than forcing developers to subclass EditForm in order to specific
an 'editform' class.

OTOH, maybe a startup check is in order, which could easily inform a
developer that 'class' (used in the editform directive) must subclass
EditForm. Any oversight by the developer could be corrected with a clear
message. Maybe this is better -- the developer would then know
explicitly what's going on.

 -- Garrett