Hello Ted. Thanks for your response. Is there a design pattern that
incorporates these helper classes? Would it be sufficient for me to
call this class an action helper? The concept of a business delegate does
not apply in this case since the code in question is not related to a
business object. If you can point me to some examples that have a similar
architecture, that would certainly help.
Also, as Frank mentioned in his response, I could populate a VO
in my action and then pass it on to a helper class to process. Is it good
Struts practice to access VOs from actions?
Any help would be appreciated. Thanks.
- Asad
On Thu, 5 Oct 2006, Ted Husted wrote:
In Struts 1, we do try to push as much logic as possible into helper
classes or business delegates, so that the logic can be tested outside
of the container. A good tipping point is whether the logic would make
any sense at all outside of the Struts API. If so, then it makes
sense to push it into another class so that it can be tested first and
then plugged into the Action.
Depending on how the file is read, you might be able to extract that
code into a helper object that could be tested outside of Struts. The
test would pass in known values, while Struts would pass in values
from the request.
-- HTH, Ted.
* http://www.husted.com/struts/
On 10/4/06, Asad Habib <[EMAIL PROTECTED]> wrote:
I have a Struts action which extracts field values from the request
object
and then uses these values to set the name of a file which the
application
reads from. The code responsible for forming the file name currently
resides in the action. Is this the best place to put it? This code
cannot
be considered business logic but rather application logic and I would
like
to decouple application logic from control logic as much as possible. Is
there a particular design pattern that Struts applications rely on to
achieve this? Is it sufficient to simply put this code in a helper
class?
Any input would be appreciated. Thank you.
- Asad
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]