On Sat, Jan 11, 2003 at 08:11:26AM -0800, Patrick Lightbody wrote:
> ThreadLocal implies that you always have a single thread throughout the
> lifecycle of the action (prepare, execute, print results). This is true for
> a servlet container (single thread/request), but not so in other areas.

Can you please tell of any other case? I think it's not to bad to
constrain the execution environment of an action the be a single thread.
The sequence of execution is sth. like Client->Dispatcher->Action, so
the real constraint would be that the Dispatcher ensures this.

> If you look at the code, the context Map is being passed around. I don't
> really see it as that bad, but I guess that's all subjective.

The usage of ThreadLocals is two edged sword. On the one hand, Thread
locals avoid to pass a context all around, but on the other hand, it
takes some time to understand how to use them. However this would actually
only affect XWork developer, not the users of XWork. IMHO Passing a context
is no pain either because this could always done in the constructor of
the Action, View or anything because theese are used only once in
webwork. So this is a matter of taste. Personally I would vote for not
using ThreadLocals, where possible.

-billy.

-- 
Meisterbohne       Söflinger Straße 100          Tel: +49-731-399 499-0
   eLösungen       89077 Ulm                     Fax: +49-731-399 499-9

Attachment: msg01149/pgp00000.pgp
Description: PGP signature

Reply via email to