[jsr-314-open] #{compositeComponent.attrs....}

Ken Paulsen Ken.Paulsen at SUN.COM
Wed Apr 8 13:07:35 EDT 2009


While perhaps it can be simplified to a shorter name, or one that
doesn't build off "compositeComponent", I feel strongly that all EL
should be given the opportunity to be specified explicitly.  For
example: #{foo} vs. #{requestScope.foo} vs. #{sessionScope.foo}, vs.
#{compositeComponent.attrs.foo}.  So, not only is there a performance
penalty for being a lazy developer and not being explicit (requiring a
search of all scopes until found), but there is also a name-space
problem.  I also argue that it hurts readability of your code to not be
explicit.  I discourage all implicit EL references -- IMO, it's simply
bad practice.

That said, we support implicit references (in addition to their explicit
alternatives) in many places, what's one more. :P

Ken


David Geary wrote:
> Is it possible to dispense with having to type
> "#compositeComponent.attrs." in the implementation sections of
> composite components? It's cumbersome. Besides, Facelets custom tags
> let you access attribute values with their simple names, for example
> you could use a Facelets tag like this:
>
> <mytags:planet name="mercury" image="#{resource['images:Mercury.gif']}"/>
>
> and in the implementation of the planet tag, you can do this:
>
> <h:graphicImage style="border: none"
>   value="#{image}"/>
>
> With a JSF composite component, you have to do
> ...value="#{compositeComponent.attrs.image}". Maybe I'm missing
> something, but it doesn't seem to be too much of a technical feat to
> remove the need to type compositeComponent.attrs (a variable resolver
> that searches compositeComponents.attrs, as necessary?)
>
> It seems weird that we're taking a step backwards in this respect,
> even as we move forward from Facelets tags to more feature-rich
> composite components.
>
>
> david
>






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