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]

Reply via email to