Tks for the reply Tim.

I now see the advantages of my latter case.
But being my form bean a DynaActionForm, can I still use
BeanUtils.populate()??
If not, what would be the alternative?

Tks
Felipe

-----Mensagem original-----
De: Tim Lucia [mailto:[EMAIL PROTECTED] 
Enviada em: domingo, 7 de dezembro de 2003 10:54
Para: 'Struts Users Mailing List'
Assunto: RE: from Action to Facade: simple attributes or Business
Objects


The philosphy is that the Actions ("controller") move bean properties
from form bean(s) into business beans, and pass the business bean into a
business object to perform an operation.  I.e., the action should
contain all of (and only) the web-specific portion of the application.
I.e., the latter case in your example.  Think about what happens if you
add a property?  How many places do you need to change it?  One less (at
least) in the patter case.  You can (typically) use BeanUtils.populate()
do move all properties in one fell swoop.

Tim Lucia


> -----Original Message-----
> From: Felipe Nascimento [mailto:[EMAIL PROTECTED]
> Sent: Saturday, December 06, 2003 10:15 PM
> To: [EMAIL PROTECTED]
> Subject: from Action to Facade: simple attributes or Business Objects
> 
> 
> Hi,
> 
> I was wondering what do experts recommend:
> 
> inside Action´s execute method we should pass the attributes
> to the Facade or create the business objects in the Action 
> and pass them on?
> 
> 1)
> execute(....){
>      Facade.addUser(name, surname, login, birth, ....);
> }
> 
> or
> 
> 2)
> execute(....){
>      User u = new User();
>      u.setName(name);
>      u.setSurname(surname);
>      ......others setters.
>      Facade.addUser(u);
> }
> 
> Tks
> Felipe
> 
> 
> 
> ---------------------------------------------------------------------
> 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]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 2/12/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.547 / Virus Database: 340 - Release Date: 2/12/2003
 


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

Reply via email to