<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 10/29/10 11:06 PM, David Geary wrote:<br>
<blockquote
 cite="mid:AANLkTimj3TV-yHYXcs7tpCPh+LfZn9OYjRGEvdrwyNS-@mail.gmail.com"
 type="cite">
  <div class="gmail_quote">
  <meta charset="utf-8">
  <div>It seems that I am perhaps the only dissenting voice here, but I
don't care for this solution.&nbsp;</div>
  <div><br>
  </div>
  <div>To those of us that understand the rationale for removing
targets and adding these cc:implements... tags, the new tags make
perfect sense. But to the uninitiated, they will be bewildering. What
does it mean for a button to "implements action source"? Buttons
already implement action source.</div>
  </div>
</blockquote>
<br>
Ed also raised this concern.&nbsp; If we are going to continue on with this
approach (and I hope that we do), perhaps we need to come up with less
ambiguous names for these tags.<br>
<br>
<br>
<blockquote
 cite="mid:AANLkTimj3TV-yHYXcs7tpCPh+LfZn9OYjRGEvdrwyNS-@mail.gmail.com"
 type="cite">
  <div class="gmail_quote">
  <div> IMO, targets are much easier to understand, and to explain.</div>
  <div><br>
  </div>
  <div>I understand the urge to remove the targets attribute based on
their OO impurity,</div>
  </div>
</blockquote>
<br>
OO purity may be part of it, though I believe that the a bigger reason
for focusing on this area is that end users (and even EG members) seem
to be having difficulty with our existing APIs.<br>
<br>
<blockquote
 cite="mid:AANLkTimj3TV-yHYXcs7tpCPh+LfZn9OYjRGEvdrwyNS-@mail.gmail.com"
 type="cite">
  <div class="gmail_quote">
  <div> but I think the solution could use some more thought.&nbsp;There are
already too many arcane oddities in JSF, whose rationale is only
intuited by high priests, and I hate to see us adding more.</div>
  </div>
</blockquote>
<br>
The "high priest" analogy does not present an especially charitable
view of what is happening here.&nbsp; We released an API in JSF 2.0 that
users are finding problematic.&nbsp; Expert group/community members have
recognized that this is a problem and are attempting to devise a
solution that would be more in line with how our users expect this to
work.&nbsp; Perhaps we are off base in aspects of this solution, but the
fact that we are looking to address a problem area is a good thing.&nbsp; I
don't think it is fair to apply the old high priest/ivory tower motif
here.<br>
<br>
My own take is that a big reason why our end users are having
difficulty with our current solution is that it is internally
inconsistent.&nbsp; In some cases implementation tags refer to interface
metadata (eg. &lt;composite:insertFacet&gt;).&nbsp; In other cases interface
metadata refers to implementation tags (eg.
&lt;composite:actionSource&gt;).&nbsp; In one case, that in retrospect seems
embarrassingly convoluted, we have bi-directional references between
interface and implementation: &lt;composite:attribute&gt;, which
sometimes uses "targets" and other times is referenced via #{cc.attrs}.<br>
<br>
Looking at the tag documentation for the &lt;composite:attribute&gt;
"targets" attribute:<br>
<br>
<blockquote type="cite">If this element has a method-signature
attribute, the value of the
targets attribute must be interpreted as a space (not tab) separated
list of client ids (relative to the top level component) of components
within the &lt;composite:implementation&gt; section. Space is used as
the delimiter for compatibility with the IDREFS and NMTOKENS data types
from the XML Schema. Each entry in the list must be interpreted as the
id of an inner component to which the MethodExpression from the
composite component tag in the using page must be applied. If this
element has a method-signature attribute, but no targets attribute, the
value of the name attribute is used as the single entry in the list. If
the value of the name attribute is not one of the special values listed
in the description of the name attribute, targets (or its derived
value) need not correspond to the id of an inner component.<br>
</blockquote>
<br>
The "name" attribute documentation isn't especially reassuring:<br>
<br>
<blockquote type="cite">The name of the attribute as it must appear on
the composite component tag in the using page. If the value of the name
attribute is equal to (without the quotes) &#8220;action&#8221;, &#8220;actionListener&#8221;,
&#8220;validator&#8221;, or &#8220;valueChangeListener&#8221;, the action described in
ViewHandler.retargetMethodExpressions() must be taken to handle the
attribute. In these cases, the method-signature attribute, if present,
must be ignored as its value is derived as described in
retargetMethodExpressions().</blockquote>
<br>
Seriously??&nbsp; After reading this, is it any wonder that our users are
flailing on this?&nbsp; If anything in this very extended email discussion
reeks of arcane high priestdom-ness, this is it.&nbsp; Wouldn't life have
been simpler for our users if &lt;composite:attribute&gt; had no
"targets" attribute whatsoever, no special-casing for the "name"
attribute and instead we simply boiled this down to: "use #{cc.attrs}
for everything"?<br>
<br>
I realize that the &lt;composite:attribute&gt; use case is a bit
different from
&lt;composite:actionSource&gt;/&lt;composite:valueHolder&gt;/&lt;composite:editableValueHolder&gt;
cases, so perhaps it would be sufficient to address the
&lt;composite:attribute&gt; insanity and stop there.&nbsp; However, I do
think it is worthwhile to look at the full solution and see whether
there is room for additional simplification/consistency.<br>
<br>
To me, &lt;composite:actionSource&gt; is not all that different from
&lt;composite:facet&gt;.&nbsp; The &lt;composite:facet&gt; API, like
&lt;composite:actionSource&gt;, could have just as easily used a target
approach.&nbsp; Yet we decided to go with this:<br>
<br>
<br>
<blockquote type="cite">&lt;composite:interface&gt;<br>
&nbsp; &lt;composite:facet name="foo"/&gt;<br>
&lt;composite:interface&gt;<br>
  <br>
&lt;composite:implementation&gt;<br>
&nbsp; &lt;bar:someComp&gt;<br>
&nbsp;&nbsp;&nbsp; &lt;composite:insertFacet name="foo"/&gt;<br>
&nbsp; &lt;/bar:someComp&gt;<br>
&lt;/composite:implementation&gt;</blockquote>
<br>
<br>
Instead of:<br>
<br>
<br>
<blockquote type="cite">&lt;composite:interface&gt;<br>
&nbsp; &lt;composite:facet name="foo" target="mySomeComp"/&gt;<br>
&lt;composite:interface&gt;<br>
  <br>
&lt;composite:implementation&gt;<br>
&nbsp; &lt;bar:someComp id="mySomeComp"/&gt;<br>
&lt;/composite:implementation&gt;</blockquote>
<br>
<br>
<br>
Why did we go with &lt;composite:insertFacet&gt; instead of "target"?&nbsp;
Which approach is easier for users?&nbsp; If we had provided both of these
approaches in 2.0, which would users prefer?<br>
<br>
In my experience I have found our id-referencing APIs to be a difficult
to work with.&nbsp; Id references can be confusing.&nbsp; It isn't always clear
whether relative or full ids should be used or what location relative
ids are relative to.&nbsp; The presence of naming containers influence the
specification of id references in ways that can trip up unsuspecting
users.&nbsp; Id references are fragile and can easily go stale when
refactoring content.<br>
<br>
I believe that we had the right idea when we went with the
&lt;composite:facet&gt;/&lt;composite:insertFacet&gt; design.&nbsp; This
solution provides a simple, clear way for the user to express their
intentions without suffering any of the above drawbacks.<br>
<br>
While I admit that the &lt;composite:actionSource&gt; case is not
identical to &lt;composite:facet&gt;, the similarities seem strong.&nbsp; If
JSF 2.0 had included a
&lt;composite:actionSource&gt;/&lt;composite:insert/implements/exposes/whateverActionSource&gt;
pair (like &lt;composite:facet&gt;/&lt;composite:insertFacet&gt;) and
had not included any notion of "targets", I don't think that our users
would have had much difficulty coping with this.&nbsp; If we had exclusively
gone with a "implementation references interface" approach (no
references from interface to implementation), I think our users would
have been altogether better off.<br>
<br>
Of course, we cannot go back and time and undo what we've started in
JSF 2.0.&nbsp; It is less important for us to question whether our original
design choices were correct than to decide whether it makes sense to
introduce new APIs now.&nbsp; In my mind, this looks like the proposals that
we have been discussion are a step in the right direction.&nbsp; I like the
consistency of this new approach; it allows users to interact with all
of our interface metadata in a similar manner.&nbsp; I am certainly open to
discussion on this, and I completely agree that we need to be careful
when pondering new APIs.&nbsp; You are right that it is critical that we
avoid unintentionally making life more difficult for our users, not
just in this case, but for all of our API decisions.<br>
<br>
Andy<br>
<br>
</body>
</html>