Hi All,

just a design question, probably beyond Struts scope, but interesting 
anyway. As the documentation says, business beans, invoked from Action 
classes must atomically handle access to resources. They should not even 
know that they are running in a web application, so they be reusable pieces.

My question is about opinions about handling exceptions. We intend use Log4J 
proyect for this task. I figure out two possible approaches:

1- handling exceptions try{}catch{} in each single business bean and logging 
to log files from them, or

2- propagate such exceptions to the invoker Action which will be responsible 
for logging and doing right treatment. For this solution, classes that 
propagate the exceptions upwards should add their identification to the 
message or whichever info necessary for identiying the exception source.

I bet for second approach, since IMHO it produces reusable beans, untied to 
log configuration. I would appreciate opinions for this concern.

Regards,

Adolfo.



_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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

Reply via email to