You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by João Paulo Batistella <ba...@yahoo.com.br> on 2003/01/14 14:35:51 UTC
Design of action classes
Hi.
We are deciding about how to use action classes in our project.
Is it a problem to let developers use the same action class to handle different operations?
Example:
The action UpdateUserAction could be used to insert a new user or to update the data of an existing user. Is it a problem? Or it's better to have InsertUserAction and SaveUserAction. They do almost the same thing so I think they could be same.
Thanks,
Joao Paulo.
---------------------------------
Busca Yahoo!
O melhor lugar para encontrar tudo o que você procura na Internet
Re: Design of action classes
Posted by Affan Qureshi <qu...@etilize.com>.
Also look at DispatchAction which provides a cleaner approach to this...
Affan
----- Original Message -----
From: "Mark Galbreath" <ma...@qat.com>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Tuesday, January 14, 2003 7:02 PM
Subject: RE: Design of action classes
I think the consensus is to use one Action class per Action form (bean).
For a simple update like you describe, it would be natural for the same
Action to update the database (actually, call a DAO or EJB) whether it's a
new user or new information for an existing user. Work through your use
cases and I think it will become apparent what Action classes are
appropriate for specific responsibilities.
Mark
-----Original Message-----
From: João Paulo Batistella [mailto:batistellabr@yahoo.com.br]
Sent: Tuesday, January 14, 2003 8:36 AM
We are deciding about how to use action classes in our project.
Is it a problem to let developers use the same action class to handle
different operations?
Example:
The action UpdateUserAction could be used to insert a new user or to update
the data of an existing user. Is it a problem? Or it's better to have
InsertUserAction and SaveUserAction. They do almost the same thing so I
think they could be same.
Thanks,
Joao Paulo.
--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Design of action classes
Posted by Mark Galbreath <ma...@qat.com>.
I think the consensus is to use one Action class per Action form (bean).
For a simple update like you describe, it would be natural for the same
Action to update the database (actually, call a DAO or EJB) whether it's a
new user or new information for an existing user. Work through your use
cases and I think it will become apparent what Action classes are
appropriate for specific responsibilities.
Mark
-----Original Message-----
From: João Paulo Batistella [mailto:batistellabr@yahoo.com.br]
Sent: Tuesday, January 14, 2003 8:36 AM
We are deciding about how to use action classes in our project.
Is it a problem to let developers use the same action class to handle
different operations?
Example:
The action UpdateUserAction could be used to insert a new user or to update
the data of an existing user. Is it a problem? Or it's better to have
InsertUserAction and SaveUserAction. They do almost the same thing so I
think they could be same.
Thanks,
Joao Paulo.
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>