Code-wise:

one action class per one logical web resource seems more natural to
me. Say, Employee. I would have one EmployeeForm, one EmployeeAction
and several JSP pages for different modes. All compact and observable
with as little stuff in config file as possible. But this is just a
preference.

Usability-wise:

One action and one action mapping make one URL. This may be important
for some (me), and not important for others. Combined with some other
development approaches, one URL may help to solve stale page problems
or implicit double submit problems. But then again, if you have one
render mapping, but you use redirection, then even with several submit
mappings you can get away with only one visible URL. So again, the
matter of taste :-)

I will think on more benefits of dispatch actions :)

On 5/4/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
And of course the simple option: separate action :)

It's absolutely true that a Dispath-type action will get rid of all the
if's, and that's good... but you will still be left with a potentially
large Action that performs a number of different (hopefully at least
related!) functions.

Me, I still prefer individual Actions that are only a few lines of actual
code a piece.  I'd rather have more smaller Actions than fewer larger
Actions.  I find it easier to comprehend an application constructed that
way, and I also find it easier to make incremental changes.  It also
potentially makes working in a team environment less contentious, although
this isn't to me a major concern.

Frank

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]
Java Web Parts -
http://javawebparts.sourceforge.net
Supplying the wheel, so you don't have to reinvent it!

On Thu, May 4, 2006 1:20 pm, Michael Jouravlev said:
> Dispatching action. Do not use old and crusty DispatchAction.
> See these links:
>
> http://wiki.apache.org/struts/EventActionDispatcher
> http://wiki.apache.org/struts/DataEntryForm
>
> Michael.
>
> On 5/4/06, Joey Watson <[EMAIL PROTECTED]> wrote:
>> hello everybody.
>>
>>   When I was working a big project. I always met this problem. coz the
>> sometimes there are a lot of event need to be handled in a single jsp
>> page. so programer need to use lots of "if - else" to deal with
>> different event  in Action.execute method. of cause. I think those
>> codes is not hard to be understant,  but sometimes it make the action
>> class too big.  Any suggestion?
>>
>> Thanks.
>>
>> Joey.
>>
>> ---------------------------------------------------------------------
>> 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]
>
>


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

Reply via email to