[Zope-dev] Context priority as an alternative to configuration directive overrides

Malthe Borch mborch at gmail.com
Thu Dec 2 08:19:31 EST 2010


On 2 December 2010 13:34, Benji York <benji at benjiyork.com> wrote:
> I appreciate the flexibility inherent in that approach, but personally,
> I'd be frightened of such a system.  I sometimes have problems figuring
> out which directives are active in the current system, if I had to
> reason about dozens of priority levels I think it'd be worse.

I think there would in general be either no priority set or a single,
non-trivial priority.

It's true that priorities in general open up for some complexity (e.g.
ordering ``zope.viewlet`` viewlets), but if used sparingly, I think
it's a reasonable approach.

> I don't quite follow the "for the rest of us" part.  Will you expand on
> that?

As far as I understand, for a ZCML include override to work properly,
you need to carefully make sure that your includes are in the exact
right order and on the same level. In a system where two packages are
trying to override the same component (should arguably never be the
csae, but it is frequently), it can be difficult to get it right.

Priorities on the other hand are absolute, globally. It's easy for
anyone to see that the highest priority wins, no matter the order of
inclusion.

\malthe


More information about the Zope-Dev mailing list