jsr341-experts@el-spec.java.net

[jsr341-experts] Re: Bean names with namespace

From: Pete Muir <pmuir_at_redhat.com>
Date: Tue, 9 Aug 2011 20:03:49 +0100

On 9 Aug 2011, at 18:02, Kin-man Chung wrote:

> I recall that it is a CDI requirement that bean names can have namespaces, such as "org.goofy.configs". Pete, is this still the case?

Yes. This is in the CDI spec, so can't be removed right away, we need to support this for at least the next revision.

> Are there any other things that EL needs to do, other than the ability to parse and evaluates it?

No.

>
> Since names that contains a "." creates ambiguities are parse time, we'll need to resolve it. I propose that we introduce another syntax notation for it, like what we did for static fields. For instance, we can write
>
> #{N(org.goofy.configs).memSize}.
>
> to denote the bean org.goofy.configs with the property memSize. What do you think?

This wouldn't work for CDI due to backwards compatibility.

Instead (or as well?), could we offer a registerNamespace() method (similar to how we are handling imports)? Then EL will have a static list of namespaces that an (optional?) namespace resolver could resolve against before other resolvers are used. CDI knows namespaces at startup so could register all it needs.

WDYT?