<div>2010/10/30 Jakob Korherr <span dir="ltr">&lt;<a href="mailto:jakob.korherr@gmail.com">jakob.korherr@gmail.com</a>&gt;</span></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi,<br>
<br>
Andy, I totally agree with you in all points mentioned in your<br>
previous mail (actually this just made my day).</blockquote><div><br></div><div>So do I. Perhaps I wasn&#39;t clear, but I agree that the problems outlined by Andy need to be addressed. I also understand, and agree with, the fact that targets is an OO misdemeanor, with an interface depending upon implementation details.</div>
<div><br></div><div>I&#39;m just not crazy about the proposed solution. Consider the following example from earlier in this thread:</div><div><br></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">&lt;composite:interface&gt;</span></div>
<div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">  &lt;composite:actionSource name=&quot;loginButton&quot;/&gt;<div class="im" style="color: rgb(80, 0, 80); ">
 &lt;/composite:interface&gt;<br><br> &lt;composite:implementation&gt;<br>  &lt;h:commandButton&gt;<br></div>    &lt;composite:implementsActionSource name=&quot;loginButton&quot;/&gt;<br>  &lt;/h:commandButton&gt;<br> &lt;/composite:implementation&gt;</span></div>
<div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><meta charset="utf-8"><span class="Apple-style-span" style="border-collapse: separate; font-family: arial; font-size: small; "><div>
In the preceding markup, the button doesn&#39;t implement the named action source, as advertised, because the action source is not an action source at all, but rather a reference to one -- and it&#39;s the action source that the button already implements! That bit of circular illogic hurts my head. It&#39;s also a lot of typing.</div>
<div><br></div><div>And then there&#39;s the problem of using the same attribute name (&quot;name&quot;) for two different things in two closely related tags. At the very least, shouldn&#39;t the &quot;name&quot; attribute of &lt;composite:implementsActionSource&gt; be something else, maybe &quot;source&quot;, for example?</div>
</span></span></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">Also, if we&#39;re going to use &quot;implements&quot;, why must we have separate tags for each type of source? Why not just &lt;composite:implements name=&quot;loginButton&quot;/&gt;? Or perhaps something more semantically correct:</span></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">&lt;composite:interface&gt;</span></div>
<div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><span class="Apple-style-span" style="border-collapse: separate; font-family: arial; font-size: small; "><div>
<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">  &lt;composite:actionSource name=&quot;loginButton&quot;/&gt;<div class="im" style="color: rgb(80, 0, 80); ">
 &lt;/composite:interface&gt;<br><br> &lt;composite:implementation&gt;<br>  &lt;h:commandButton&gt;<br></div><div class="im" style="color: rgb(80, 0, 80); "><meta charset="utf-8"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: arial; font-size: small; "><div>
<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">    <b>&lt;composite:references source=&quot;loginButton&quot; </b>(or perhaps refersTo instead of references)</span></div>
</span></div>  &lt;/h:commandButton&gt;<br> &lt;/composite:implementation&gt;</span></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><br></span></div>
</span></span></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Is it just possible to do this with component ids, and forgo the extra tag altogether?</span></font></div>
<div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><br></span></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><meta charset="utf-8"><span class="Apple-style-span" style="border-collapse: separate; font-family: arial; "><div>
<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">&lt;composite:interface&gt;</span></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><span class="Apple-style-span" style="border-collapse: separate; font-family: arial; font-size: small; "><div>
<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">  &lt;composite:actionSource name=&quot;loginButton&quot;/&gt;<div class="im" style="color: rgb(80, 0, 80); ">
 &lt;/composite:interface&gt;<br><br> &lt;composite:implementation&gt;<br>  &lt;h:commandButton id=&quot;loginButton&quot;&gt;</div>  &lt;/h:commandButton&gt;<br> &lt;/composite:implementation&gt;</span></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><br>
</span></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">Finally, perhaps I missed this in the thread, but does this solution let a composite component author bind multiple targets (sorry) to a single source?</span></div>
<div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">Again, I agree with the problems that Andy so eloquently described. I&#39;d just like to see us take a little more time to think through the solution.</span></div>
<div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><br>
</span></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">david</span></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><br>
</span></div></span></span></div></span></span></font></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> And I most liked the<br>
following paragraph:<br>
<div class="im"><br>
&gt;Seriously??  After reading this, is it any wonder that our users are flailing on this?  If anything in this very extended email discussion reeks of arcane high priestdom-ness, this is it.  Wouldn&#39;t life have been simpler for our users if &lt;composite:attribute&gt; had no &quot;targets&quot; attribute whatsoever, no special-casing for the &quot;name&quot; attribute and instead we simply boiled this down to: &quot;use #{cc.attrs} for everything&quot;?<br>

<br>
</div>IMHO: Yes, totally!<br>
<br>
The current solution really is internally inconsistent, and<br>
furthermore many developers (and as you mentioned: even EG members)<br>
are having trouble with it. I myself implemented a lot of this for<br>
MyFaces, but I still have problems when using it without looking at my<br>
cheat-sheet...<br>
<br>
And it&#39;s not just the inconsistency: the ID-reference approach really<br>
is something we should stay away from, because no-one actually knows<br>
which ID to use: full clientid? last part of the clientid? what about<br>
naming containers? or even worse: what about data tables or<br>
&lt;ui:repeat&gt; (because they add an index to the clientId)? Doing a<br>
back-reference to the interface section here seems just soooo much<br>
better.<br>
<br>
David, although I know you don&#39;t really like the OO reference here,<br>
but IMO the target approach is even worse than this:<br>
<br>
public interface MyInterface implemented-by Foo, Bar, Bas {}<br>
<br>
... because even in this scenario you definitely would know the<br>
package of Foo, Bar and Bas (or in other words: you would know which<br>
client-id to use).<br>
<br>
However, I always know how to insert a facet into a composite<br>
component, because this approach is very intuitive. Thus I think the<br>
right thing to do is to add those tags for actionSource, valueHolder,<br>
editableValueHolder and clientBehavior too and to &quot;get rid&quot; of the<br>
targets-solution.<br>
<br>
In the case of actionSource, valueHolder and editableValueHolder I<br>
really like &quot;implementsXXX&quot;, because it shows that the certain<br>
implementation component implements this functionality for/of the<br>
composite component. However in the case of clientBehavior, I think we<br>
should go with cc:insertClientBehavior, just as we did with<br>
cc:insertFacet, because facets and clientBehaviors are somehow related<br>
here..<br>
<br>
To wrap this up again, I&#39;d propose to add these tags for JSF 2.1 in<br>
order to make the life of our users a lot easier:<br>
<br>
&lt;cc:implementsActionSource name=&quot;XXX&quot; /&gt;<br>
&lt;cc:implementsEditableValueHolder name=&quot;XXX&quot; /&gt;<br>
&lt;cc:implementsValueHolder name=&quot;XXX&quot; /&gt;<br>
&lt;cc:insertClientBehavior name=&quot;XXX&quot; /&gt;<br>
<br>
Regards,<br>
Jakob<br>
<br>
<br>
<br>
2010/10/30 Andy Schwartz &lt;<a href="mailto:andy.schwartz@oracle.com">andy.schwartz@oracle.com</a>&gt;:<br>
<div><div></div><div class="h5">&gt; On 10/29/10 11:06 PM, David Geary wrote:<br>
&gt;<br>
&gt; It seems that I am perhaps the only dissenting voice here, but I don&#39;t care<br>
&gt; for this solution.<br>
&gt; To those of us that understand the rationale for removing targets and adding<br>
&gt; these cc:implements... tags, the new tags make perfect sense. But to the<br>
&gt; uninitiated, they will be bewildering. What does it mean for a button to<br>
&gt; &quot;implements action source&quot;? Buttons already implement action source.<br>
&gt;<br>
&gt; Ed also raised this concern.  If we are going to continue on with this<br>
&gt; approach (and I hope that we do), perhaps we need to come up with less<br>
&gt; ambiguous names for these tags.<br>
&gt;<br>
&gt;<br>
&gt; IMO, targets are much easier to understand, and to explain.<br>
&gt; I understand the urge to remove the targets attribute based on their OO<br>
&gt; impurity,<br>
&gt;<br>
&gt; OO purity may be part of it, though I believe that the a bigger reason for<br>
&gt; focusing on this area is that end users (and even EG members) seem to be<br>
&gt; having difficulty with our existing APIs.<br>
&gt;<br>
&gt; but I think the solution could use some more thought. There are already too<br>
&gt; many arcane oddities in JSF, whose rationale is only intuited by high<br>
&gt; priests, and I hate to see us adding more.<br>
&gt;<br>
&gt; The &quot;high priest&quot; analogy does not present an especially charitable view of<br>
&gt; what is happening here.  We released an API in JSF 2.0 that users are<br>
&gt; finding problematic.  Expert group/community members have recognized that<br>
&gt; this is a problem and are attempting to devise a solution that would be more<br>
&gt; in line with how our users expect this to work.  Perhaps we are off base in<br>
&gt; aspects of this solution, but the fact that we are looking to address a<br>
&gt; problem area is a good thing.  I don&#39;t think it is fair to apply the old<br>
&gt; high priest/ivory tower motif here.<br>
&gt;<br>
&gt; My own take is that a big reason why our end users are having difficulty<br>
&gt; with our current solution is that it is internally inconsistent.  In some<br>
&gt; cases implementation tags refer to interface metadata (eg.<br>
&gt; &lt;composite:insertFacet&gt;).  In other cases interface metadata refers to<br>
&gt; implementation tags (eg. &lt;composite:actionSource&gt;).  In one case, that in<br>
&gt; retrospect seems embarrassingly convoluted, we have bi-directional<br>
&gt; references between interface and implementation: &lt;composite:attribute&gt;,<br>
&gt; which sometimes uses &quot;targets&quot; and other times is referenced via<br>
&gt; #{cc.attrs}.<br>
&gt;<br>
&gt; Looking at the tag documentation for the &lt;composite:attribute&gt; &quot;targets&quot;<br>
&gt; attribute:<br>
&gt;<br>
&gt; If this element has a method-signature attribute, the value of the targets<br>
&gt; attribute must be interpreted as a space (not tab) separated list of client<br>
&gt; ids (relative to the top level component) of components within the<br>
&gt; &lt;composite:implementation&gt; section. Space is used as the delimiter for<br>
&gt; compatibility with the IDREFS and NMTOKENS data types from the XML Schema.<br>
&gt; Each entry in the list must be interpreted as the id of an inner component<br>
&gt; to which the MethodExpression from the composite component tag in the using<br>
&gt; page must be applied. If this element has a method-signature attribute, but<br>
&gt; no targets attribute, the value of the name attribute is used as the single<br>
&gt; entry in the list. If the value of the name attribute is not one of the<br>
&gt; special values listed in the description of the name attribute, targets (or<br>
&gt; its derived value) need not correspond to the id of an inner component.<br>
&gt;<br>
&gt; The &quot;name&quot; attribute documentation isn&#39;t especially reassuring:<br>
&gt;<br>
&gt; The name of the attribute as it must appear on the composite component tag<br>
&gt; in the using page. If the value of the name attribute is equal to (without<br>
&gt; the quotes) “action”, “actionListener”, “validator”, or<br>
&gt; “valueChangeListener”, the action described in<br>
&gt; ViewHandler.retargetMethodExpressions() must be taken to handle the<br>
&gt; attribute. In these cases, the method-signature attribute, if present, must<br>
&gt; be ignored as its value is derived as described in<br>
&gt; retargetMethodExpressions().<br>
&gt;<br>
&gt; Seriously??  After reading this, is it any wonder that our users are<br>
&gt; flailing on this?  If anything in this very extended email discussion reeks<br>
&gt; of arcane high priestdom-ness, this is it.  Wouldn&#39;t life have been simpler<br>
&gt; for our users if &lt;composite:attribute&gt; had no &quot;targets&quot; attribute<br>
&gt; whatsoever, no special-casing for the &quot;name&quot; attribute and instead we simply<br>
&gt; boiled this down to: &quot;use #{cc.attrs} for everything&quot;?<br>
&gt;<br>
&gt; I realize that the &lt;composite:attribute&gt; use case is a bit different from<br>
&gt; &lt;composite:actionSource&gt;/&lt;composite:valueHolder&gt;/&lt;composite:editableValueHolder&gt;<br>
&gt; cases, so perhaps it would be sufficient to address the<br>
&gt; &lt;composite:attribute&gt; insanity and stop there.  However, I do think it is<br>
&gt; worthwhile to look at the full solution and see whether there is room for<br>
&gt; additional simplification/consistency.<br>
&gt;<br>
&gt; To me, &lt;composite:actionSource&gt; is not all that different from<br>
&gt; &lt;composite:facet&gt;.  The &lt;composite:facet&gt; API, like<br>
&gt; &lt;composite:actionSource&gt;, could have just as easily used a target approach.<br>
&gt; Yet we decided to go with this:<br>
&gt;<br>
&gt;<br>
&gt; &lt;composite:interface&gt;<br>
&gt;   &lt;composite:facet name=&quot;foo&quot;/&gt;<br>
&gt; &lt;composite:interface&gt;<br>
&gt;<br>
&gt; &lt;composite:implementation&gt;<br>
&gt;   &lt;bar:someComp&gt;<br>
&gt;     &lt;composite:insertFacet name=&quot;foo&quot;/&gt;<br>
&gt;   &lt;/bar:someComp&gt;<br>
&gt; &lt;/composite:implementation&gt;<br>
&gt;<br>
&gt; Instead of:<br>
&gt;<br>
&gt;<br>
&gt; &lt;composite:interface&gt;<br>
&gt;   &lt;composite:facet name=&quot;foo&quot; target=&quot;mySomeComp&quot;/&gt;<br>
&gt; &lt;composite:interface&gt;<br>
&gt;<br>
&gt; &lt;composite:implementation&gt;<br>
&gt;   &lt;bar:someComp id=&quot;mySomeComp&quot;/&gt;<br>
&gt; &lt;/composite:implementation&gt;<br>
&gt;<br>
&gt;<br>
&gt; Why did we go with &lt;composite:insertFacet&gt; instead of &quot;target&quot;?  Which<br>
&gt; approach is easier for users?  If we had provided both of these approaches<br>
&gt; in 2.0, which would users prefer?<br>
&gt;<br>
&gt; In my experience I have found our id-referencing APIs to be a difficult to<br>
&gt; work with.  Id references can be confusing.  It isn&#39;t always clear whether<br>
&gt; relative or full ids should be used or what location relative ids are<br>
&gt; relative to.  The presence of naming containers influence the specification<br>
&gt; of id references in ways that can trip up unsuspecting users.  Id references<br>
&gt; are fragile and can easily go stale when refactoring content.<br>
&gt;<br>
&gt; I believe that we had the right idea when we went with the<br>
&gt; &lt;composite:facet&gt;/&lt;composite:insertFacet&gt; design.  This solution provides a<br>
&gt; simple, clear way for the user to express their intentions without suffering<br>
&gt; any of the above drawbacks.<br>
&gt;<br>
&gt; While I admit that the &lt;composite:actionSource&gt; case is not identical to<br>
&gt; &lt;composite:facet&gt;, the similarities seem strong.  If JSF 2.0 had included a<br>
&gt; &lt;composite:actionSource&gt;/&lt;composite:insert/implements/exposes/whateverActionSource&gt;<br>
&gt; pair (like &lt;composite:facet&gt;/&lt;composite:insertFacet&gt;) and had not included<br>
&gt; any notion of &quot;targets&quot;, I don&#39;t think that our users would have had much<br>
&gt; difficulty coping with this.  If we had exclusively gone with a<br>
&gt; &quot;implementation references interface&quot; approach (no references from interface<br>
&gt; to implementation), I think our users would have been altogether better off.<br>
&gt;<br>
&gt; Of course, we cannot go back and time and undo what we&#39;ve started in JSF<br>
&gt; 2.0.  It is less important for us to question whether our original design<br>
&gt; choices were correct than to decide whether it makes sense to introduce new<br>
&gt; APIs now.  In my mind, this looks like the proposals that we have been<br>
&gt; discussion are a step in the right direction.  I like the consistency of<br>
&gt; this new approach; it allows users to interact with all of our interface<br>
&gt; metadata in a similar manner.  I am certainly open to discussion on this,<br>
&gt; and I completely agree that we need to be careful when pondering new APIs.<br>
&gt; You are right that it is critical that we avoid unintentionally making life<br>
&gt; more difficult for our users, not just in this case, but for all of our API<br>
&gt; decisions.<br>
&gt;<br>
&gt; Andy<br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
</div></div>--<br>
<div><div></div><div class="h5">Jakob Korherr<br>
<br>
blog: <a href="http://www.jakobk.com" target="_blank">http://www.jakobk.com</a><br>
twitter: <a href="http://twitter.com/jakobkorherr" target="_blank">http://twitter.com/jakobkorherr</a><br>
work: <a href="http://www.irian.at" target="_blank">http://www.irian.at</a><br>
</div></div></blockquote></div><br>