[Zope3-dev] what is ZCML?

Jim Fulton jim at zope.com
Mon Mar 13 19:03:58 EST 2006


Alec Mitchell wrote:
...
> <adapter factory=".MyFactory" />
> 
> I was a bit disturbed.  What's the point? 

The point is that you are using the adapter.

 > It tells you nothing unless you
> refer to the actual implementation. 

It tells you that the adapter is being used.

 > Why not just put the registration in
> python alongside the implementation if that's where the configuration of 
> provided and required interfaces is going to be? 

No, that's where the declaration is.  For smaller (non-Zope)
applications, you could configure them in Python.  For Zope,
we want people to override your configuration without modifying
your code.  ZCML lets them do that.


 > I had considered one of
> zcml configuration's greatest benefits was that it could give a high level 
> overview of how pieces of a package were interconnected.  Of course it's 
> still possbile to do things the old way, but I get the impression that it's 
> discouraged.  Brevity is not always a boon, though that cuts both ways here 
> (adding a new "magical" seeming zcml declaration to save a copy/paste here 
> and there may not be the best idea either).

I understand how you feel here.  It *would* be nice to have the information
in both places *if* you didn't have to maintain it in both places.  There is
a tradeoff between avoiding duplication and making things cleared for the person
reading ZCML.  If I have to choose where to put the information, I far prefer
having it in Python.

Jim

-- 
Jim Fulton           mailto:jim at zope.com       Python Powered!
CTO                  (540) 361-1714            http://www.python.org
Zope Corporation     http://www.zope.com       http://www.zope.org


More information about the Zope3-dev mailing list