I have been working on a series of pages that follow a "guided tour" approach where 
the logic used to determine the next routing may have not much to do with the updates 
that are performed by the action. The guided tour somewhat resembles a maze in a few 
places and sometimes relates to information gathered a few pages back in the tour. For 
instance, the business rules may say that after updating the database to say that you 
want "Global Van Lines" to move 5 boxes of stuff to the address XYZ, route to the data 
entry screen for customs form data for international moves, or route to the data entry 
page for moving stuff into temporary storage if that type of move was picked two pages 
back, or route the flow to the data entry page for moving a boat if that was the thing 
chosen to be moved 1 page back in the tour... etc.
So the decision making for what the next page in the tour is has nothing to do with 
the action of updating the database with "Global Van Lines" and I would prefer to put 
the logic for it in a separate class with a "whereNext()" method that is executed if 
the Action passes... lets say... a null ActionForward AND a "routing decision" class 
is configured for the action.
 David Graham <[EMAIL PROTECTED]> wrote:I'm confused by your question. The value 
returned from an Action *is* an 
ActionForward. Actions are already simply routing logic anyways. All 
actions should basically look like this

1. Perform business logic validation if necessary
2. Call business layer method to perform logic.
3. Return appropriate ActionForward to route to.

Seems like it's already as simple as it needs to be. You might look at 
DispatchAction if you don't want a large number of Action classes.

David






>From: Tony Baity 
>Reply-To: "Struts Users Mailing List" 
>To: [EMAIL PROTECTED]
>Subject: flow control decision making
>Date: Mon, 20 Jan 2003 20:43:25 -0800 (PST)
>
>
>Hello,
>
>I've been off the list for a while... busy coding up about 60 action 
>classes and all the JNDI behind them.
>
>One thing I found about using the struts_config file is that it is a lot 
>easier to refactor, fix flawed business rules dealing with page flow, etc 
>in the struts config xml than it is to yank the java code around in the 
>action classes. For instance, if I found that action X really needed to 
>route to targets a, b, c and d instead of Action Y, I have to move the 
>logic out of Action Y and put in into Action X whereas in the struts config 
>all I need to do is move the >elements.
>
>I was thinking of developing a way to make the routing logic separate from 
>the business logic that does all the data accessing and updating. But all I 
>can think of is to create another action class to forward to for handling 
>this.
>
>Is there a way to specify in the struts_config a class that an >element can use just 
>for determining the action_forward and to ignore the 
>value returned by the action class.
>
>-Tony
>
>
>
>---------------------------------
>Do you Yahoo!?
>Yahoo! Mail Plus - Powerful. Affordable. Sign up now


_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* 
http://join.msn.com/?page=features/junkmail


--
To unsubscribe, e-mail: 
For additional commands, e-mail: 



---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

Reply via email to