[Zope3-dev] what is ZCML?
Jean-Marc Orliaguet
jmo at ita.chalmers.se
Tue Mar 14 07:30:18 EST 2006
Jim Fulton wrote:
>
> Yup.
>
> BTW, a general thing to keep in mind:
>
> - Indirection and abstraction are inherently bad because they
> hide things. :)
> (This is a corolary of "explicit is better than implicit".)
>
> - But indirection and abstraction can provide benefits that outweight
> their inherent bad-ness.
>
> Whenever we consider ptoviding a high-level/automated facility, we have
> to weigh the benefit against the inherient badness.
> [...]
>
> Jim
>
yes, except that ZCML adds strictly no abstraction compared to what
would have been written in python. It only "paraphrases" python by
hiding lines of code. When I look at a zcml directive I often have to
read that handler's code to see what it actually does and I have to find
the objects, classes in files, .. that it handles.
that's 2 indirections, but no abstraction
Abstraction would in the case of ZCML mean that paths to python modules
and classes would be hidden, that objects (adapters, pages, menus) could
be given a shorter name that I could use inside ZCML for configuration
purposes without registering these names in zope, it would mean that I
could group directives together in a set and apply rules to it without
always refering to the location of each individual object on the
filesystem, that I wouln't have to do a grep on all zcml files when I
move or rename files (I would register paths only once) ... It would
mean that I could register all images inside a folder without listing
them all one by one.
This would be the beginning of something called 'abstraction', but
that's still far away from it :-).
best
/JM
More information about the Zope3-dev
mailing list