myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Myfaces Wiki] Update of "Trinidad_FacesBean_and_PartialStateSaving" by MatthiasWessendorf
Date Fri, 04 Dec 2009 07:57:51 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Myfaces Wiki" for change notification.

The "Trinidad_FacesBean_and_PartialStateSaving" page has been changed by MatthiasWessendorf.
http://wiki.apache.org/myfaces/Trinidad_FacesBean_and_PartialStateSaving

--------------------------------------------------

New page:
The Trinidad mplementation of !FacesBean already supported partialStateSaving, and for Trinidad's
JSF 2 offerings it's now a [[https://issues.apache.org/jira/browse/TRINIDAD-1630|PartialStateHolder
]]

One reason is !FacesBean uses propertyKeys, which allow additional information like capabilities.

Beyond that Andy Schwartz had actually taken a look at this previously. Here's what he found.

In theory the ideal solution should be to remove !FacesBean in favor of the new standard APIs.
However, in practice, there are two issues:

 1. We need to maintain backwards compatibility.
 2. Trinidad's !FacesBean solution is more efficient than the standard solution.

Note that the compatibility issues (#1) mainly impact component/renderer authors (not application
developers), yet is still an important issue for us.

Regarding efficiency (#2)... !FacesBean has two benefits over the standard solution. First,
!FacesBean supports indexed property keys, allowing for very efficient property lookups. Second,
the Trinidad approach avoids overhead involved in the JSF's attribute-property transparency
mechanism. When using the JSF implementation of UIComponent.getAttributes().get("foo"), the
following steps are performed:

  * First, look up the attribute in the attribute map.
  * If not found, use reflection to call the property getter (eg. getFoo()) on the component
instance.
  * The getter then performs yet another lookup on the !StateHelper.

This approach allows property look ups to be more easily customized via subclassing (ie. by
overriding accessor methods). Trinidad sacrifices this flexibility for performance. Attribute
lookups are routed directly to the !FacesBean without invoking component accessor methods.

Mime
View raw message