[jsr-314-open] [JSF 2.1 NEW] composite component namespace simplification

Pete Muir pmuir at redhat.com
Wed Dec 9 06:11:58 EST 2009


On 8 Dec 2009, at 17:55, David Geary wrote:

> 
> I would like to know *why* this being proposed as well.
> 
> I proposed it because when I was teaching JSF 2.0 someone asked me why they had to type all that stuff before the component directory. I didn't have a good answer. I still don't, actually. I never really have understood why XML namespaces are specified as URLs.

They aren't required to be, they are required to be URIs, of which most are URLs, and some are URNs.

> 
> Fundamentally, JSF developers are drowning in complexity. We should be doing everything we can to simplify instead of obfuscate. Why should page authors have to remember to puthttp://java.sun.com/jsf/composite before the directory name, when the directory name is the only significant part of the namespace?

Right, but I believe your proposal further muddies the water and makes it even more confusing for new developers by not following the XML standards

> 
> And then there's precedent: With Flex, you pull all Flex components in a directory, say components/util, by doing exactly what I proposed, although with Flex, you can specify and individual component, like this...
> 
> xmlns="components/util/coolDateComponent"
> 
> or all of the components in the util directory:
> 
> xmlns="components/util/*"
> 
> If it's good enough for Flex, I don't see why it's not good enough for us.

Because it is wrong and breaks the XML Schema RFC (I can dig out the exact bit where this is specified if needed)?

> Flex, btw, is pretty popular, and is doing very well in the marketplace, and one of the main reasons is that it's conceptually simple.

Well, I think the main reason it is popular is because it is simple to produce pretty graphics, animations etc. - I think if JSF had similar features, no one would be worrying about the length of the URI.

> Most JSF page authors have no idea what the difference is between a URN or a URL.

Right, but that is not really what we are discussing - what we are discussing is URN vs URL vs JSF-hacked-URI. 

> And they have no idea why the have to specify such a long, ugly, and difficult to remember prefix to the directory when all they want to do is specify the directory.

Agreed, I don't think for the composite components we made the best choice for URI schema, IMO it should have been more like 

xmlns:pete="composite:components/pete"

- the big difference to the original proposal is that we are still within the URI scheme guidelines because we use a scheme name. By defining our own scheme, we are then free to choose how the "hierarchical part" looks. Arguably we could go for a less generic scheme name like "faces" or "jsf":

xmlns:pete="faces:composite:components/pete"

which is a bit longer but more generic...



More information about the jsr-314-open-mirror mailing list