commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Germuska <...@Germuska.com>
Subject [chain] lookups and context wrappers
Date Fri, 07 Jan 2005 15:09:58 GMT
I'm starting to work on a process for Struts which wraps the incoming 
Context class in an "ActionContext" class which knows more about the 
Struts API.  I am sort of feeling my way along and I have a few ideas 
which might belong in the chain core, so I thought I'd solicit some 
opinions.

I wonder if the LookupCommand should have some configurable facility 
for wrapping contexts; it seems like that might occasionally be a 
valuable service, and it might be nice not to have to subclass 
LookupAction just to put a wrapper around the context.  I'm thinking 
that you could configure either a wrapper class name or a 
ContextFactory type class name (we'd decide which was better; no need 
to actually do it both ways).  Then, if lookup found that it was so 
configured, it would prepare the context which it passed along to the 
looked-up command by using the wrapping facility.

To me a Factory implies a new context instance based off of the old 
one.  This would require a lot more overhead in copying values to and 
from the context on either side of the dispatch to the sub-command. 
So I prefer a wrapper which actually uses the underlying context to 
store values, but structures the way in which things go in there.  It 
seems like this might be risky, but it's also much less overhead.

Any ideas about this?  I have a draft ContextWrapper class in 
progress which I could share.  Even if we decide it doesn't belong in 
the chain core, I'll probably continue along this path for Struts 
unless someone points out a phenomenal oversight in the basic 
approach.

Joe

-- 
Joe Germuska
Joe@Germuska.com
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message