[Zope3-dev] Re: One namespace for ZCML

Tres Seaver tseaver at palladion.com
Tue Feb 14 07:07:30 EST 2006

Hash: SHA1

Philipp von Weitershausen wrote:
> Martijn Faassen wrote:


>> I suspect quite
>> a few of the directives that can go away are in the 'small' namespaces,
>> such as mail. We may also want to move some directives to other
>> namespaces. If all directives disappear from a namespace, so can the
>> namespace. The potential for win can be much larger while the potential
>> for breakage is much smaller, as we can do this step by step.
> I agree. As we do that, we should also try to figure out when and how we decide
> what goes into its own namespace and what doesn't. Currently ZCML namespaces
> are used to:
> * Differentiate between different view types (generic vs. browser vs. xmlrpc)
> * Mark the domain of a certain registration (i18n, mail, rdb, help)
> * Associate directives with a certain, perhaps optional package (apidoc, other
> 3rd party packages)
> Why does apidoc have its own namespace and, say, zope.app.securitypolicy
> doesn't? Or why did zope.viewlet not put its directives into the 'viewlet'
> namespace but into the 'browser' namespace? All that seems arbitrary to me.
> Just as the fact that I'm "supposed" to put my frobnatz directive into the
> plone namespace even if a frobnatz is actually a browser thing.

I think the clue here is to put your directives into a namespace whose
UIR you "control":  in the case of 3rd-party packages managed outside of
the 'zope' package, I think that this means somewhere other thatn
'namespaces.zope.org' (the prefix, of course, is rebindable on a per
file basis).

I think 'zc.resourcelibrary' does this wrong, injecting its
'resourceLibrary' directive into the main 'zope' namespace;  perhaps
'http://namespaces.zope.org/zc' would be better.

>> I really think that the discussion on namespaces is so common not
>> because it's so important, but because it's an easy thing to comment on
>> and talk about. People are less likely to have huge discussions about
>> larger but harder to understand issues.
> Perhaps. But it also seems like they're talking about it because it bugs them a
> lot. Tres seems to think that we shouldn't worry about those "trolls". I'm
> inclined to think that if people have issues with ZCML and welcome
> simplifications, we should consider coming up with some. So far I'm the only
> one who has made constructive suggestions for doing so beyond Jim's adapts()
> hook (I won't count suggestions that seek to replace ZCML with ZConfig, YAML,
> etc.).

I don't think objecttions based on "why do I have to type the namespace
declrartion?" are valid:  they get trumped by "explicit is better than
implicit," if nothing else.

- --
Tres Seaver          +1 202-558-7113          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org


More information about the Zope3-dev mailing list