struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Reumann <strut...@reumann.net>
Subject Re: [HELP] How could I catch and process Errors in Struts + iBatis + DAO?
Date Thu, 24 Mar 2005 20:14:06 GMT
Yuniar Setiawan wrote the following on 3/23/2005 6:57 AM:
> There is a good example at
> http://www.reumann.net/struts/ibatisLesson1.do about this. download
> the sample war and look inside.

Actually as Leon pointed out to me, my example isn't that good for 
Exception handling. (Sorry I wrote it fast and was lazy:)

Do NOT follow that example as a 'best practices' for Exception handling 
- it's anyting but good for that. (The example is more for a demo of 
using the basics of a struts-iBATIS-Dao integration - but I definitely 
cut corners in places).

One example is in the Action, even though I use a service class (which 
really is a facade if I have my design pattern names correct), I don't 
catch a "ServiceException" in my Action but instead I catch a 
DAOException. I think it best to insulate yourself in the Action from 
anything related to the DAO and instead just catch some 
ServiceException(maybe call it DataAcessFacade vs service would be 
better also).

-- 
Rick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message