I have a use case in wich a user will be created if its ID is 
null, or updated otherwise. 

What would be the preferrable approach?

a) My business services layer provides both createUser() and 
updateUser(), and I determine wich one to call inside my 
Action (by testing user.getId() ), or:

b) My business services layer provides a saveUser() method 
wich will have the necessary logic inside. This way all my 
Action needs to do is build a User object and pass it to 
the service layer.

I like the second one better. However, I've read that Struts
actions can be considered part of the controller layer; the first
option above does treat the action as a "controller" (there's 
logic in it), whereas option b) considers it to be something more
presentation-bound (almost no logic, simply converts requests 
into objects). 

Are there any advantages/pitfalls to these strategies?

TIA
- ventura


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

Reply via email to