[Zope3-dev] Re: [Zope3-checkins] CVS: Zope3/src/zope/app/browser/services - add_svc_config.pt:1.2 useconfiguration.pt:1.2 useconfiguration.py:1.2 configure.zcml:1.21 service.py:1.7 add_service_1.pt:NONE add_service_2.pt:NONE

Jeffrey P Shell jeffrey@cuemedia.com
Tue, 4 Mar 2003 13:45:10 -0700


On Monday, March 3, 2003, at 06:41  PM, Tres Seaver wrote:

> On Mon, 2003-03-03 at 18:16, Guido van Rossum wrote:
>> - Some miscellaneous cleanup (e.g. made the browser namespace the
>>   default namespace in zope/app/browser/services/configure.zcml).
>
> This part worries me, for two reasons:
>
>   - Doesn't the "default namespace" declaration on the outermost
>     element put that element into that namespace as well?
>
>   - What benefit is there in using a seemingly different namespace
>     for those directives here?  Wouldn't clarity be better served
>     by making 'browser:page' the normative spelling everywhere?  I
>     realize that expat has no problem with a different default
>     namespace, but humans have to parse ZCML too, and changing
>     the default makes them work harder than they should need to.
>     Doesn't the same objection obtain here as to the Python,
>     'from some_module import *'?

I agree.  I was just looking at another piece of ZCML in the traversal 
package and it took me a while to figure out that all of the elements 
in the file were out of a different namespace than I was used to.  As 
such, it took a lot longer to grok than I would have liked.  This is 
the bit about namespaces and XML that I've hated - while examples of 
XML with namespaces use full names and look all nice and neat, too many 
shortcuts happen in reality and the whole "human AND machine readable" 
aspect of XML goes out the window.  It's not always the case, but (for 
example) I've yet to be able to understand any XML generated by a 
Microsoft product.

And while I acknowledge (and don't even mind) ZCML as it stands now - I 
still stand by my experience coming across a ZCML file compared to the 
XML configuration files used by other offerings (such as Servlets).  
The servlet files were much easier to understand and edit at first 
glance.  ZCML is a lot more powerful and flexible, but we should try to 
keep it understandable.  I don't want to be scratching my head over the 
differences between the following when I'm going through the myriad of 
different ZCML files on my system as I prepare to deploy::

<zopeConfigure xmlns="http://namespaces.zope.org/browser">
  <page name="index.html" template="error.pt" ... />
  ...
</zopeConfigure>

<zopeConfigure xmlns="http://namespaces.statemachine.net/pager">
  <page name="Jeff" onevent=".events.SystemDown" ... />
  ...
</zopeConfigure>


Or maybe I just need to train my eyes to read XML better.. *sigh*.