[Zope3-dev] Re: Better access to APIs in paths (was Re: needingviewsclues - template/title troubles)

Evan Simpson evan@4-am.com
Fri, 28 Feb 2003 16:36:09 -0600


Jim Fulton wrote:
> I think that there is enough interest in making path-segment
> namespaces extensible via some sort of namespace declarations
> that it is time for someone to work up a detailed proposal.
> The proposal should describe the syntax and semantics for
> defining namespaces for use in path segments.

I'm not sure at this point exactly what the things associated with these 
namespaces are, but I'm going to use "API" and not worry for the moment 
what an "API" is, exactly.  My ignorance of Zope3 may make the following 
painfully inaccurate, but hopefully the core idea will come across.  I 
apologize if all of this is obvious to everyone.

Each API has a Zope "address", namely a module path such as 
'zope.app.interfaces.dublincore.IZopeDublinCore'.  A valid URI scheme 
for naming APIs would therefore be 'api_module:<path>', as in 
'api_module:zope.app.interfaces.dublincore.IZopeDublinCore'.

Since an 'api_module:<path>' URI exposes implementation details, it is 
fragile.  If Plone used a 'api_module:some.path.to.IPlone' URI to 
declare 'plone' for its ZPTs, that might not break anything, but a Plone 
add-on that wanted to declare 'plone' could easily be broken by an 
implementation change.  This implies that Plone should register a 
"semantic" URI for its API, and as long as it is going to do that it 
should probably *use* that URI.

The URIs used to declare namespaces may be copied from XML usage, such 
as Dublin Core's 'http://purl.org/dc/elements/1.1/', but they *are not* 
XML URIs.  API namespaces and XML namespaces are completely independent 
of each other, and an XML document processor will not care about either 
the declaration or use of an API namespace.  It would be a big mistake 
to abuse the "xmlns:foo=" notation for API declarations.

This being the case, I see no reason not to use simple, memorable URI 
schemes such as 'plone:1.0' or 'format:currency/1.2'.

Cheers,

Evan @ 4-am