[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

Jim Fulton jim@zope.com
Tue, 04 Mar 2003 09:08:44 -0500


Tres Seaver wrote:
> On Mon, 2003-03-03 at 18:16, Guido van Rossum wrote:
> 
> <snippage>
> 
>>- 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?

Yes.  In December I arranged that zopeConfigure and include are in
all namespaces to make this sort of thing possible.


>   - What benefit is there in using a seemingly different namespace
>     for those directives here?

By "those directives" I assume you mean things like "page" and "menuItem".
The namespace hasn't changed.

 >     Wouldn't clarity be better served
>     by making 'browser:page' the normative spelling everywhere? 

I don't think so.  I wouldn't recommend choosing a different prefix.
But in cases where all of the interesting directives are in one namsspace,
I think that readability is improved by letting that namespace be the
default.


 >     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.

I really don't think this is the case. I think the reduction in
clutter far outweights the fact that the prefix is omitted.

>     Doesn't the same objection obtain here as to the Python,
>     'from some_module import *'?

The problem is that with from "some_module import *", it's hard to tell
which symbols came from the module and which symbols were buitins or
imported some other way. That's because you typically have lots of other symbols
floating around.

I only recommend changing the default namespace when all of the elements are
in that namespace. That is, when there is only one xmlns attribute.

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