<!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>
  &lt;composite:implementation&gt;

    &lt;!-- 1. Expression directly in the implementation --&gt;
    &lt;h:outputText value=&quot;#{cc.attrs.value}&quot;&gt;

    &lt;!-- 2. Expression in non-composite component facet --&gt;
    &lt;bar:someJavaComposite&gt;
      &lt;f:facet name=&quot;someFacet&quot;&gt;
        &lt;h:outputText value=&quot;#{cc.attrs.value}&quot;&gt;
      &lt;/f:facet&gt;
    &lt;/bar:someJavaComponent&gt;

    &lt;!-- 3. Expression in composite component facet --&gt;
    &lt;foo:someCompositeComponent&gt;
      &lt;f:facet name=&quot;someFacet&quot;&gt;
        &lt;h:outputText value=&quot;#{cc.attrs.value}&quot;&gt;
      &lt;/f:facet&gt;
&nbsp;&nbsp;&nbsp; &lt;/foo:someCompositeComponent&gt;

</PRE>
</BLOCKQUOTE>
<PRE>

</PRE>
<TT><FONT COLOR="#1a1a1a">&nbsp;&nbsp;&nbsp; &lt;!-- </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"> --&gt;</FONT></TT><BR>
<TT><FONT COLOR="#1a1a1a">&nbsp;&nbsp;&nbsp; &lt;bar:some</FONT></TT><TT>CompositeComponent </TT><TT><FONT COLOR="#1a1a1a">value=&quot;#{cc.attrs.value}&quot;</FONT></TT><TT> /&gt;</TT><BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>

  &lt;/composite:implementation&gt;
</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, &quot;adhere to the principle of least surprise&quot;. <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>