#659 Rename sys::Namespace to sys::UriSpace

tompalmer Wed 8 Jul 2009

I was reviewing comments on a recent blog post of mine and noticed some confusion over the term "namespace". For programming languages, I think people expect "namespace" to mean the same thing as in C++ or C#. That is, the same thing as "package" in Java or "pod" in Fan. This is very different from the current term "namespace" in Fan. I suppose the current Fan term comes from JNDI terminology and such like, but I think it can still lead to confusion.

Would it be possible to find a new term for Fan namespaces? Maybe calling it a blackboard or registry would be a common term used elsewhere for this kind of feature?

Just trying to consider the possibility.

brian Wed 8 Jul 2009

I can see that confusion:

  • one is the language's namespace of pods/types/slot
  • the other is the namespace of URI access

Although technically the language namespace is a subset of the URI namespace (since you can access all pods, types, and slots via the "fan:" scheme (or should be able to).

If we rename, I'd probably go with "UriSpace"

andy Wed 8 Jul 2009

I've never really liked that term as well - so I would welcome a rename - UriSpace would be ok with me.

tompalmer Wed 8 Jul 2009

UriSpace sounds good. Just learned from a Google search that the W3C has two top hits mentioning "URISpace" and "URI space". I'd never heard of the former, but the latter is a document I've seen before, and its use of "URI space" matches the intended meaning for Fan almost perfectly.

I'll guess most other folks haven't heard of URISpace, so it won't cause confusion.

tcolar Wed 8 Jul 2009

URISpace or registry are good. Agreed on namespace being confusing.

brian Wed 8 Jul 2009

Promoted to ticket #659 and assigned to brian

brian Wed 8 Jul 2009

Renamed from "Namespace" confusion to Rename sys::Namespace to sys::UriSpace

brian Wed 8 Jul 2009

Ticket resolved in 1.0.45

This change is pushed to hg:

Namespace    => UriSpace
Sys.ns       => UriSpace.root
Sys.ns(Uri)  => UriSpace.find
Sys.mount    => UriSpace.mount
Sys.unmount  => UriSpace.unmount

I am not entirely happy with the new API though, before you used to manage CRUD of resources like:

Sys.ns.create(`/foo`, foo)
Sys.ns.get(`/foo`)

But now this is:

UriSpace.root.create(`/foo`, foo)
UriSpace.root.get(`/foo`)

Semantically it is exactly the same, but a little confusing since you go thru the root uri space to get/create/put/delete, but at the same time it might not be managed by the root uri space.

Any other ideas or a short sweet name for UriSpace.root?

tcolar Wed 8 Jul 2009

UriSpace.store.get(/foo) ?

tompalmer Wed 8 Jul 2009

at the same time it might not be managed by the root uri space.

I haven't used the UriSpace system, so I might not follow all the details. But the current docs for Sys.ns say "if uri is omitted, then get the root namespace". Why wouldn't it be the root then?

An alternative still could be to go back to Sys with Sys.uris. Seems a bit of a name abuse but maybe clear enough and almost as short as before.

tompalmer Wed 8 Jul 2009

I looked more at the docs now. So, it's a URI relative to the root but not necessarily managed by the root namespace object. Hmm.

By the way, the sample on that page could say TimeNamespace() now (instead of TimeNamespace.make), if you want.

Login or Signup to reply.