[Zope3-dev] Re: Better access to APIs in paths
Tres Seaver
tseaver@zope.com
27 Feb 2003 10:49:23 -0500
On Thu, 2003-02-27 at 08:53, Shane Hathaway wrote:
> On Thu, 27 Feb 2003, Chris Withers wrote:
>
> > Shane Hathaway wrote:
> > >
> > > If prefixes map directly to components or interfaces, the new syntax is
> > > really specific to Zope. Every time you want to create a new API, you
> > > have to be sure no one else has staked a claim to the prefix you want.
> > > Even if you're using page templates outside Zope, you have to be sure no
> > > one in the Zope community has taken your prefix, because you might want
> > > to interoperate with Zope someday, and you don't want to change your
> > > prefix. So effectively, all the namespaces are centralized and
> > > controlled by Zope. That could be a problem for interesting prefixes
> > > with ambiguous meanings like "workflow", "versions", "api", "db", etc.
> >
> > This is an amazingly good point and a very good reason to go for
> > namespaces IMNSHO... Could they be made easier to swallow by allowing
> > 'default' namespace-to-prefix mappings being made outside the template
> > or would this leave us back at this problem?
>
> Default prefixes are good for two cases that I can think of: common
> minimal presentation operations that are currently difficult to write but
> shouldn't be (and shouldn't require any Python), and access to core Zope
> APIs (to make writing templates easy in Zope). There's no conflict in
> those cases and the default prefixes would be a service to all template
> authors.
Maybe I'm just being dense, but can't we solve the "default namespaces"
issue by defining the defaults in the 'main_template', in which *every*
"normal" Zope page template will wrap itself? Then people who want to
re-bind the defaults, or add new ones, will just customize that template
(or the macro which defines the namespaces :).
Tres.
--
===============================================================
Tres Seaver tseaver@zope.com
Zope Corporation "Zope Dealers" http://www.zope.com