[Zope3-dev] ZCML alternative

Jim Fulton jim@zope.com
Sun, 02 Jun 2002 10:40:04 -0400


Itamar Shtull-Trauring wrote:
> 
> Stephan Richter wrote:
> 
> > Actually nothing changed really. All he had to do is provide his own z3.py
> > file and deactivate some of the server setup ZCML. It was actually not as bad
> > as he made it sound.
> 
> Not true. I wanted to make my server a drop-in replacement for z3.py. In
> order to do that I had to read in the ZCML, and replace the ZCML server
> definition with my own, which I couldn't figure out how to do.

> "Deactivating some of the ZCML" meant I had a server that ignored most
> of the ZCML config files, with no way to get them working, so I could
> not get a functional zope3 server going.

The answer for this is simple. All that needs to be changed is to move 

  <include file="startup.zcml" />

out of site.zcml and to have z3.py execute startup.zcml, which should
be renamed "zserver.zcml". I just checked this change int into the 
"Zope3InWonderland-branch", which, I hope, will get merged into the main
branch next week.

I did this for a similar reason. I finally got around to a beginning of
a Zope debugger. The Zope debugger needs to initialize the application
without initializing any servers, since, effectively, *it* is the server.
 
> Which is ridiculous - if I could get zpublisher hooked up to my own HTTP
> server in 2 hours, why couldn't I or Shane manage to make it a
> replacement for z3.py in the same amount of time? The answer being ZCML.
>   It made it *much* more complex to hook up, and I needed to figure out
> obscure code paths and read whole modules to figure out how the hell
> this stuff all worked. Which I didn't manage to do, so I gave up.
> 
> If there's one thing I learned from Zope2, it is this - do NOT require a
> lot of work for developers to get something going. Having additional
> functionality is great, powerful tools are wonderful, but DON'T require
> people to understand them or force them to use them before they can
> start developing.
> 
> You could argue that it's my fault, I don't know enough about Zope3,
> etc. - and this is true. But Shane didn't figure it out either, and he
> certainly knows a lot more than I do about Zope3.

I'm bothered that you has so much trouble. ZCML was certainly not the problem.
A simple change to the site zcml file is all that's needed to get rid of ZServer.
I discussed this with Shane, but maybe that was after he tried to help you.

A different issue is integrating with the new publishing architecture. Perhaps
that compounded your troubles. Neither the old architecture nor the new one are
simple or well documented. I suspect the difference is that Shane wrote the old
one, and so could tell you just what you needed to do, but Shane is unfamiliar with
the new architecture.

Jim

--
Jim Fulton           mailto:jim@zope.com       Python Powered!        
CTO                  (888) 344-4332            http://www.python.org  
Zope Corporation     http://www.zope.com       http://www.zope.org