• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is it right to write a GenericDAO ?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Bartender
Posts: 1844
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving this to the EJB forum.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic