Craig McClanahan wrote:
On 8/31/05, Rich Feit <[EMAIL PROTECTED]> wrote:
I actually agree that a single bean is better than a lot of separate
values under various keys. In Beehive we put most of our request-scoped
values onto a request wrapper -- this turned out to have better
performance than doing the attribute lookup all over the place. But
it's a similar idea.
JSF likes a single "context" bean as well (FacesContext). One choice that
JSF also made should be considered here, in terms of providing access ...
there's a static FacesContext.getCurrentInstance() method that returns the
current context object for the current request thread (it's implemented with
a ThreadLocal). The nice thing this does is eliminates the need to have any
magic attribute key at all, as well as *having* to pass the context object
in to every single method call.
This is exactly what XWork provides, ActionContext, and it also uses a ThreadLocal. I wrote a ControllerContext, which
uses the map from ActionContext as storage for its attributes, and Rich wrote a PageFlowContext which extends
ActionContext. Obviously, we need to consolidate our contexts :) Still, I'm not convinced everything can/should fall
under one Context. For example, XWork has a ValidationContext which I think we should keep separate but make available
through our primary context, whatever that may be.
Don
Craig
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]