Forums Register Login
Is it right to write a GenericDAO ?
I am using Struts,usually, we write entity beans for critical database tables, and.. every entity bean has it's own DAO. These DAOs do insert/update/delete/finder work over it's entity bean.
I wrote a genericDAO, handled all entity beans. Using RTTI(RunTime Type Identification), I am not sure if it's the general way to handle this problems?
Any suggestion?
I certainly use a generic DAO to do all of my data access. Mine is more an entire Persistence Engine rather than a single DAO, but while it may lack in performance it makes up for it in flexibility and ease-of-coding. I never write SQL/deal with ResultSets any more; my engine does that for me.
This frees me from dependency on any one database or application server. This means that I can provide the same code to any application without having to change it to work against MSAccess or Oracle or XML data sources.
Of course I have to provide information to my engine for it to do its work, but I wrote a tool for that
My $.02
Moving this to the EJB forum.
Continue the conversation here.
[ May 12, 2003: Message edited by: Cindy Glass ]

This thread has been viewed 570 times.

All times above are in ranch (not your local) time.
The current ranch time is
Dec 10, 2018 17:24:01.