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

Shane Hathaway shane@zope.com
Fri, 28 Feb 2003 21:52:54 -0500


On 02/28/2003 05:36 PM, Evan Simpson wrote:
> 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.

(Jim: Thanks for considering this!)

(snip)

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

I don't quite follow, Evan.  Are you saying that Plone needs to register 
a URI that embeds the version of the API?  (That's a tradeoff and a 
decision not to be taken lightly... but you might not be saying that. ;-) )

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

I think you're saying that the TAL parser shouldn't look at "xmlns:foo" 
to gather TAL path namespaces.  I can definitely agree with that.  This 
short debate has refined my understanding of these various concepts, and 
XML namespaces are absolutely nothing like TAL path namespaces, except 
that both use URIs.  URIs, not XML namespaces, are the interesting 
concept that give us extensibility.

But I quite like the suggested "talns:foo=" syntax.  What do you think 
of it?

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

Well, the scheme of a URI should be something well-recognized by the 
Internet community at large.  I think URNs are often used for this 
purpose, so maybe a better URI would be "urn:plone/1.0" or 
"urn:formats/currency/1.2" (or "urn:formats/1.2").  I'm still trying to 
figure out the real purpose of URNs, though (other than for ashes left 
over after cremation.) ;-)

I think we should plan to have APIs and metadata namespaces registered 
against several URIs.  I don't think we ought to get too deep into those 
details, though, without a proposal that describes what URIs we might use.

Shane