At 9:14 AM +0200 6/8/06, Julian Tillmann wrote:
Thank you for your replies!
When I understand this right:
- Giving Actions a state using Spring makes no sence
Not so much "makes no sense" as "doesn't get you anything." At
least, once you are used to writing threadsafe actions, you don't see
as much value. The value of request-scoped, stateful actions comes
with a design like that used in WebWork and Struts 2.0, where the
request parameters are used to populate properties of the Action
itself, instead of being wrapped in an ActionForm and passed in.
- It cannot be recommended to overwrite the request processor
with Spring (we already have our own)
This isn't quite true either. If you're using Struts 1.2.x and
Spring, there's no reason not to use Spring's
DelegatingRequestProcessor or DelegatingTilesRequestProcessor --
especially since they set you up to use the IOC (see below). The
issue is only if you are using Struts 1.3 (or Struts 1.2.x with the
struts-chain library) -- in this case, since you can only have one
RequestProcessor, using Spring's will interfere with using the one
which uses the Chain-of-Responsibility for handling the request.
However, if you look at what the DelegatingRequestProcessor does
(remember, this is open source!), it's not hard to write your own
replacement for the SelectAction command that provides equivalent
functionality.
- But the spring Context offers some new possibilites
like IOC but to be honest I'm not expert enough
to understand this up to date!
This is the Spring feature that I appreciate the most. Before we
started using Spring, it was always awkward to make sure that your
Action classes had references to business support and persistence
manager classes. While there are plenty of solutions, all of them
looked clumsy after we saw how we could use Spring to "inject" those
dependencies into the action classes directly.
Thanks I watched this example of IBM with the interceptor.
Which other business-cases (aspects) could you reasonable use this way?
Isn't this a performance problem, because interceptors always have
to use refelection?
Reflection performance has been markedly improved since earlier
editions of the JVM. Struts already uses it all over the place
(specifically for ActionForm population on every request, plus a lot
of stuff at initialization time.) Do you have an application which
needs extremely careful performance tuning?
Joe
--
Joe Germuska
[EMAIL PROTECTED] * http://blog.germuska.com
"You really can't burn anything out by trying something new, and
even if you can burn it out, it can be fixed. Try something new."
-- Robert Moog
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]