<!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 8/17/10 4:32 PM, Blake Sullivan wrote:
<blockquote cite="mid:4C6AF1EB.20204@oracle.com" type="cite">
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
The actual performance of the implementation.&nbsp; We've measured the
performance of the current implementation and the overhead is
non-negligible.&nbsp; I agree that if the proposal is to reread the
context-parameter on each call, that would be far too expensive.&nbsp;
Faster, if grosser implementations could involve storing a final
boolean on the UIComponent.<br>
</blockquote>
<br>
How about we combine Ed and Kito's proposals?<br>
<br>
Ed:<br>
<br>
<blockquote type="cite">
  <pre wrap="">Due to our iron-clad commitment to backwards compatibility, we keep the
public static final String constants, but alter the behavior, providing
a context-param to restore the old behavior.

The constants will only be honored if the context param is set.
  </pre>
</blockquote>
<br>
Kito:<br>
<br>
<blockquote type="cite">Couldn't you modify the map to return the
constant values for the
proper keys? That way, they would be read-only values that don't need
to be stored, the Map just needs to know the keys.</blockquote>
<br>
So, the combined solution would be:<br>
<br>
By default these keys are not honored.&nbsp; Applications that want to call:<br>
<br>
<blockquote type="cite">FacesContext.getAttributes().get(UIComponent.CURRENT_COMPONENT)</blockquote>
<br>
Instead of:<br>
<br>
<blockquote type="cite">UIComponent.getCurrentComponent()</blockquote>
<br>
(Why?)<br>
<br>
Can set a context parameter that forces the the FacesContext
implementation to use a Map that specially handles get() calls for the
old keys.<br>
<br>
For fun, in development project stage we can detect/warn about attempts
to reference these attributes by key and recommend the type-safe
alternatives.<br>
<br>
Andy<br>
<br>
</body>
</html>