gnl.org">OGNL library.
Optimization of the Expression
There's a lot of room for optimization here because we can count on some portions of the expression to be effectively static. Note that we type the root object as {@link IComponent}. We have some expectations that certain properties of the root (and properties reachable from the root) will be constant for the lifetime of the binding. For example, components never change thier page or container. This means that certain property prefixes can be optimized:
- page
- container
- components.name
This means that once an ExpressionBinding has been triggered, the {@link #toString()} method may return different values for the rootcomponent and the expression than was originally set.
Identifying Invariants
Most expressions are fully dynamic; they must be resolved each time they are accessed. This can be somewhat inefficient. Tapestry can identify certain paths as invariant:
- A component within the page hierarchy
- An {@link org.apache.tapestry.IAsset} from then assets map (property
assets
) - A {@link org.apache.tapestry.IActionListener}from the listener map (property
listeners
) - A bean with a {@link org.apache.tapestry.spec.BeanLifecycle#PAGE}lifecycle (property
beans
) - A binding (property
bindings
)
These optimizations have some inherent dangers; they assume that the components have not overidden the specified properties; the last one (concerning helper beans) assumes that the component does inherit from {@link org.apache.tapestry.AbstractComponent}. If this becomes a problem in the future, it may be necessary to have the component itself involved in these determinations.
@author Howard Lewis Ship
@version $Id: ExpressionBinding.java 243862 2004-03-30 22:40:25Z hlship $
@since 2.2