> -----Original Message-----
> From: David Cherryhomes [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 14, 2002 10:50 PM
> To: Struts Developers List
> Subject: Re: concerns about Struts
> 

[snip]

> As Dave Peckham pointed out, you can have multiple
> pages/requests map to the same Action class. The question you
> have to ask in doing this is this: where do I stop? You do not
> want the entire app, but only a specific set of related
> functions mapping to the same Action class. When we did this at
> my shop, we had about 20 different possibilities across 5 pages.
> This resulted in a horribly long if/else block, and to make it
> more complex, some of the "ifs" would have to execute other
> "ifs" (e.g., if it comes in blank, do the same as if it came in
> as read unless parameter x is null, etc.). To address this, I
> broke the "ifs" into individual methods, then simply used the
> incoming "action" parameter and, using reflection, executed the
> appropriate method (null or "" mapped to a default method). This
> is a much more OO structured approach than an if/else statement
> and allows for cross-method invocation.

FYI, that's what org.apache.struts.actions.DispatchAction does.

--
Martin Cooper


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

Reply via email to