EJB design: Pattern to manage tables?? DAO??
- Posted by: Mauricio Alarcon
- Posted on: July 03 2003 12:32 EDT
I'm looking for some pattern that can encapsulate all the access to a RDMBS tables, now i'm using DAO with and abstract factory but this mean that if I want to persists some object the implementation of this DAO needs to know the exactly SQL string to manage this.. So there is some pattern that could be more flexible in the way that only I call with the parameters, the type of operation (insert, update, delete,..) and the name of the table and it can made the operation???
Is this a problem of JDBC and not a pattern?? is this a hard coded library?? some ideas to manage this??
Thanks in advance
- Pattern to manage tables?? DAO?? by Sean Sullivan on July 03 2003 21:41 EDT
- Thanks, Solution with Abstract factory and Command pattern by Mauricio Alarcon on July 04 2003 17:41 EDT
- Pattern to manage tables?? DAO?? by Brian Chan on July 04 2003 11:55 EDT
- SpringFramework, JDBC by Sean Sullivan on August 26 2003 18:54 EDT
- hibernate help by Ria K on March 04 2007 21:40 EST
see pages 390 to 407 in the book "Core J2EE Patterns" - http://www.phptr.com/corej2eepatterns
read Chapter 4 in "Enterprise JavaBeans Component Architecture: Designing and Coding Enterprise Applications" - http://www.asgteach.com/books/enterprise_java_beans.htm
com.ibatis.db.dao package in http://sourceforge.net/projects/ibatisdb
Benefits of DAO in a J2EE application: http://www.codefutures.com/firestorm/benefits/
presentation from JavaOne 2001: http://java.sun.com/javaone/javaone2001/pdfs/2399.pdf
DAO discussion: http://www.mail-archive.com/users at avalon dot apache dot org/msg00164.html
Thanks for your soon replay, I read somthing about you send me and desing a solution based on a Abstract Factory pattern that factory's some command like Selec Insert, etc. so in this way I can do the effect, No wI 'm try to generate another Abstract Factory that create for me the particualr DAO over the tables.
Use Hibernate (hibernate.sourceforge.net) instead of straight JDBC.
You can follow the command patterns. I believe this is discussed in the EJB desgin patterns book available at this website. Basically your class implements an interface with an execute method and maybe some method to set your parameters etc.
If you are looking for a JDBC abstraction layer, look at the
Spring Framework, http://www.springframework.org/
If you want to see example DAO code, visit
you can check spring tutorial at http://www.techfaq360.com/tutorial/spring/spring.jsp
Hi, Some of good questions on Hibernate at http://hibernate-questions.weebly.com Thanks.
hi i am new to hibernate and also discussion of theserverside. Can anyone pls help me to solve my doubts? Actully I have to develop a standalone application, so hibernate is a good choice or not for that? Thanks!