<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.26.0">
</HEAD>
<BODY>
<BR>
On Tue, 2009-09-15 at 18:34 -0400, Andy Schwartz wrote:<BR>
<BLOCKQUOTE TYPE=CITE>
<TT><FONT COLOR="#1a1a1a">I feel that </FONT></TT><BR>
<TT><FONT COLOR="#1a1a1a">the current behavior violates the principle of least surprise (both </FONT></TT><BR>
<TT><FONT COLOR="#1a1a1a">Lincoln and I were surprised) and also breaks encapsulation (ie. </FONT></TT><BR>
<TT><FONT COLOR="#1a1a1a">introduces implementation-specific dependencies).</FONT></TT><BR>
</BLOCKQUOTE>
<BR>
Andy, I agree. <BR>
<BR>
+1<BR>
<BR>
In every other EL situation, values are rooted in the context within which they were defined. I didn't give it too much thought at first, but this would definitely be counter-intuitive.<BR>
<BR>
This is probably stating the obvious, but I don't want to forget about use case #4: passing as an attribute should also behave the same way (see inline.)<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
<composite:implementation>
<!-- 1. Expression directly in the implementation -->
<h:outputText value="#{cc.attrs.value}">
<!-- 2. Expression in non-composite component facet -->
<bar:someJavaComposite>
<f:facet name="someFacet">
<h:outputText value="#{cc.attrs.value}">
</f:facet>
</bar:someJavaComponent>
<!-- 3. Expression in composite component facet -->
<foo:someCompositeComponent>
<f:facet name="someFacet">
<h:outputText value="#{cc.attrs.value}">
</f:facet>
</foo:someCompositeComponent>
</PRE>
</BLOCKQUOTE>
<PRE>
</PRE>
<TT><FONT COLOR="#1a1a1a"> <!-- </FONT></TT><TT>4</TT><TT><FONT COLOR="#1a1a1a">. Expression in composite</FONT></TT><TT> </TT><TT><FONT COLOR="#1a1a1a">component a</FONT></TT><TT>ttribute</TT><TT><FONT COLOR="#1a1a1a"> --></FONT></TT><BR>
<TT><FONT COLOR="#1a1a1a"> <bar:some</FONT></TT><TT>CompositeComponent </TT><TT><FONT COLOR="#1a1a1a">value="#{cc.attrs.value}"</FONT></TT><TT> /></TT><BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
</composite:implementation>
</PRE>
</BLOCKQUOTE>
<BR>
It boggles my mind thinking about how to go about implementing this, but it needs to happen in order to, as Andy said, "adhere to the principle of least surprise". <BR>
<BR>
--Lincoln<BR>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
--<BR>
<B>Lincoln Baxter, III</B><BR>
Co-Founder of <A HREF="http://ocpsoft.com">OcpSoft</A><BR>
Author of <A HREF="http://ocpsoft.com/prettyfaces">PrettyFaces</A> URL Rewriting for JSF<BR>
<BR>
<BR>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>