I find that this can still be a valid solution, even when business logic is entirely 
factored out of Actions.  For example, I have Form A and Form B, both of which nest 
Form C.  My Actions are all related to LookupDispatchActions.  Action A checks the 
request for Form A specific submissions, and then calls Action C to check for Form C 
specific submissions.  Similarly, Action B checks the request for Form B specific 
submissions, and then calls Action C to check for Form C specific submissions.  Since 
my business logic is well factored, I could have had Action A and Action B check all 
the same stuff in the request that Action C does, and then call all the same business 
logic that Action C does, but why?  Then, I would have to do the same in every Action 
processing a Form which nests Form C.  Action C always handles whatever Form C may 
sumbit on any form in which it is nested; I instantiate it, and execute it, and it's 
up to the "parent" Action to determine what to do with the returned
 forward.
 
I had been doing this with chaining, but we all know where that leads ;)
 
m

Andrew Hill <[EMAIL PROTECTED]> wrote:
Danny is right you know. I probably didnt stress the point well enough in my
own response to the question just now.
You would be much better off doing a spot of refactoring.

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Thursday, 4 September 2003 22:37
To: [EMAIL PROTECTED]
Subject: RE: Can we create a Action class object


Why? This sounds like bad design. Why not just refactor the common
code out into a helper class and call that from both actions?

--
Danny Yates



-----Original Message-----
From: Ashok.D [mailto:[EMAIL PROTECTED]
Sent: 04 September 2003 14:42
To: Struts Users Mailing List
Subject: Can we create a Action class object


Hi,

Can we create a Action class object. I need to access the perform method
from another Action class.

If we access this Action class by using *.do, I have some limiations in my
application. I don't want to use action.do.

But I need to execute another action class perform method.

Pls put some light on this issue.

Thanks & Regards,
Ashok.D


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_____________________________________________________________________
Notice to recipient:
The information in this internet e-mail and any attachments is confidential
and may be privileged. It is intended solely for the addressee. If you are
not the intended addressee please notify the sender immediately by
telephone. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on it,
is prohibited and may be unlawful.

When addressed to external clients any opinions or advice contained in this
internet e-mail are subject to the terms and conditions expressed in any
applicable governing terms of business or client engagement letter issued by
the pertinent Bank of America group entity.

If this email originates from the U.K. please note that Bank of America,
N.A., London Branch, Banc of America Securities Limited and Banc of America
Futures Incorporated are regulated by the Financial Services Authority.
_____________________________________________________________________



---------------------------------------------------------------------
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]



---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software

Reply via email to