[Zope3-dev] How does Zope.Configuration work?

Guido van Rossum guido@python.org
Fri, 22 Mar 2002 16:07:33 -0500


> I wanted to better understand what all the directives in .zcml files
> meant.  I assume they are connected to specific class / methods /
> functions in the Zope package.  So when I write <zmi:factoryFromClass
> ...> this is in some way connected to some code in Zope.App.ZMI
> package.
> 
> Assuming this model is correct, how does the implementation connect
> directives to code?  I've been trying to read the xmlconfig code, but
> I find it hard going.  I'm not too familiar with XML handling code and
> there seems to be a lot of abstraction / indirection.  Could someone
> offer some hints about what's going on?  I'd be happy to turn them
> into some comments or a doc string for the benefit of future readers.

I'd love to have a discussion on configuration.  Maybe we can have an
extra jam at ZC next Wednesday, when PL is in FB?

My own config-related pet peeve is slightly different.  IIUC, the
config files exist so that the site admin can change the setup.  Now,
that makes sense for things like mapping permissions to operations,
and making certain operations available (e.g. where a "jobboard"
factory should show up).

But as we were working on our little jobboard app this week, we had to
write a lot of config code that was needed purely to get our app
working, and any changes the site admin would make to them would
either have no effect or break the app.  Examples: the various
<browser:view .../> declarations are essential for tying the
components of the app together, and its components are designed to
work together exactly in the way they are tied together.

I'd like to see either a way to say "don't touch this config file and
don't change these settings" or (preferably) a way to express those
immutable aspects of the configuration directly in Python rather than
in XML.

--Guido van Rossum (home page: http://www.python.org/~guido/)