[Zope3-dev] spelling of namespace signifiers
Jim Fulton
jim@zope.com
Wed, 05 Jun 2002 14:06:37 -0400
Shane Hathaway wrote:
>
> Steve Alexander wrote:
> > Casey Duncan wrote:
> >
> >>
> >> Just from a simple complication analysis of the above,
> >> container/view--bar.html looks like a pretty viable option
> >
> >
> > I agree. +1 from me.
> >
> > Earlier in this thread, Guido said he prefered that too.
> >
> > In an email conversation I had with Jim today, he mentioned a preference
> > for this spelling.
> >
> >
> > Are there any compelling objections to container/view--somename.html ?
> >
> > If not, I'll consider this to be the way forward, and make this change
> > on the Zope3InWonderland branch.
>
> I'll express my interpretation of the above in Python:
>
> parts = traversed_name.split('--', 1)
> if len(parts) == 2:
> namespace, name = parts
> else:
> namespace, name = 'content', traversed_name
>
> Is that your interpretation?
No. The part before the first -- is the namespace and the
part after the first -- is the name.
> Unfortunately, "--" can appear in lots of
> valid filenames, especially since it's the standard ASCII representation
> of long hyphens.
I've never seen it in any. Have you?
> How about "container/--view-somename.html"? Then it almost resembles a
> command-line option. ;-)
Or Steve's container/--view--somename.html
> Still, I'm a bit leery of the namespace appearing in the final part of
> the path.
Why? I'm not.
> Here are my thoughts:
>
> 1) Our story is that the namespace qualifier isn't necessary for
> non-containerish objects, and necessary for containerish objects.
It's not necessary for containerish objects if the item and view namespaces
don't overlap.
> 2) It follows that relative links between views of containerish objects
> will take a different form than relative links between views of
> non-containerish objects.
Not necessarily. They wouldn't look much different with some proposals.
> 3) Therefore views intended for non-containerish objects can't be used
> on containerish objects. But views intended for containerish objects
> can be used anywhere.
No, you just have to spell the URLs differently.
> 4) Wanting to reach a broader audience, Zope 3 developers will tend to
> always use namespace qualifiers.
> "container;views/somename.html" avoids this. But like Jim said, it
> makes it a little harder to switch namespaces. How often will we want
> to switch namespaces?
Not often, but that makes it even worse, cause you'll need deep zen to
figure out what to do when you do.
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