  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Tomcat - JSP/Servlet container | | Struts - A MVC web framework | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | JSP - A mailing list about Java Server Pages specification and reference | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | |
Struts & Hibernate
|
|
|
  | | | Subject: DAO, Entity CMP, Strategy | Subject: DAO, Entity CMP, Strategy 2004-09-22 - By Ricardo de Souza Moura
Back I wish I can to do all my database access by a DAO. But, what if I have a Entity CMP ? Would be a good pratice to use a Strategy pattern ?
for sample:
/* DAO Interface */ public Interface CustomerDAO{ public void insertCustomer(String name); }
/* DAO implementation */ public class CustomerDAOEJBImpl implements CustomerDAO{ Context context; EJBHome home;
public CustomerDAOEJBImpl(){ context = InitiContext(); home = context.lookup(...); }
public void insertCustomer(String name){ home.create(name); }
}
thanks in advance
__ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ ____ __ MSN Messenger: converse com os seus amigos online. http://messenger.msn.com.br
==================================================================== Companion Site: http://www.corej2eepatterns.com J2EE BluePrints: http://java.sun.com/blueprints/corej2eepatterns List Archive: http://archives.java.sun.com/archives/j2eepatterns-interest.html Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)
|
|
 |