Java Mailing List Archive

http://www.junlu.com/

Google
Google
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
Subjects
JSP editor plugin for eclipse ?
org apache jasper JasperException: Unable to compile class for JSP
Tomcat: Connection reset by peer: socket write error
Cannot retrieve definition for form bean null
Struts Tiles Tutorial (free Struts training)
Where do I download Tomcat 4 0 6?
Data Access Object (DAO) pattern, example DAO 's
Where to download Tomcat v 4 1 24 from?
Tomcat 5 0 16 Requested resource not available
Subject: Servlet : Session invalidate
Oracle Connection Pooling in 3 2 2
Servlet action is currently unavailable
Tomcat/Struts Unicode Encoding/Decoding problems
Subject: Running a Simple JMS Example
Tomcat and webapplication specific java library path
Mapping in workers2 properties
org apache jasper JasperException
problem with html:text bean throwing exception
Cannot find message resources under key org apache struts action
   MESSAGE
Cannot find message resources under key org apache struts action MESSAGE
invalid direct reference problem with solution
Tool for jsp debug Try Sysdeo Eclipse Plugin
Tomcat 5 Cannot load JDBC driver class 'null ' SQL state: null
weblogic ejbc
java properties file
Jboss 3 2 3 Coyote Can 't re
Tomcat 5, Apache2 and mod jk2 integration problem
JBoss example problem new to J2EE
Value attribute of <html:checkbox
url string for connecting jboss to oracle
javax servlet ServletException: BeanUtils populate
5 0 18: Windows XP Pro vs Windows 2000
HTTP Status 404 The requested resource is not available
 
Designing BusinessObjects (again) [Was Confusion with BusinessObject impleme

Designing BusinessObjects (again) [Was Confusion with BusinessObject impleme

2004-08-26       - By Bayarsaikhan VOLODYA (YAZ-ArGe)

 Back
Reply:     1     2     3  

Good job.


i don't use any application server, so EJB logic is far away from me.
According to me, there should be UserDAOFactory (not userfactory)
otherwise for every user that we created, we should call setDAO method and
there will be so many references to UserDAO.
UserDAOFactory is singleton, return UserDAO which have create(UserPK pk),
findByPrimaryKey(UserPK pk), blah blha

user shouldnot update, create, delete itself. because it is not Information
Expert of itself. UserDAOFactory (as yours UserFactory) is reponsible for User.


This is only my opinion. if i am wrong, let me know and lead me to right way.

Bayarsaikhan VOLODYA



// creating a new user
UserData data = // populate data
UserFactory uf = // get user factory
User user = uf.create(data);

// Finding a user
UserPK pk = // populate user primary key
UserFactory uf = // get user factory
User user = uf.findByPrimaryKey(pk);

// Updating a user
UserData data = // populate data from user input
UserFactory uf = // get user factory
UserPK pk = // populate user primary key
User user = uf.findByPrimaryKey(pk);
user.copy(data); // disallows modification of user identity
user.update();


-- --Original Message-- --
From: Robert Taylor [  <mailto:rtaylor@(protected)> mailto:rtaylor@(protected)
.COM]
Sent: Thursday, August 26, 2004 2:55 PM
To: J2EEPATTERNS-INTEREST@(protected)
Subject: Designing BusinessObjects (again) [Was Confusion with BusinessObject
implementations]


Sorry for returning to this subject as I know I've already posted
about it but I've done a lot of reading and asking questions and
have worked through several implementations and think I have finally
come to a sound solution. I have a complete explanation along with
UML, ER diagram, and pseudo-code posted here:

<http://bellsouthpwp.net/r/o/robertkaren6465/pages/java/bo/> http:/
/bellsouthpwp.net/r/o/robertkaren6465/pages/java/bo/


I'ld be very grateful for any feedback, comments or constructive
critigue and welcome any questions.

robert

====================================================================
Companion Site:  <http://www.corej2eepatterns.com> http://www.corej2eepatterns
.com
J2EE BluePrints:  <http://java.sun.com/blueprints/corej2eepatterns> http://java
.sun.com/blueprints/corej2eepatterns
List Archive:  <http://archives.java.sun.com/archives/j2eepatterns-interest
.html> http://archives.java.sun.com/archives/j2eepatterns-interest.html
Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to listserv@(protected)



====================================================================
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)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859 (See http://iso-8859.ora-code.com)-1">
<TITLE></TITLE>

<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY>
<P><FONT size=2>Good job.</FONT></P>
<P><FONT size=2><BR>i don't use any application server, so EJB logic is far
away
from me.<BR>According to me, there should be UserDAOFactory (not
userfactory)<BR>otherwise for every user that we created, we should call setDAO
method and there will be so many references to UserDAO.<BR>UserDAOFactory is
singleton, return UserDAO which have <STRONG>create(UserPK pk),
findByPrimaryKey(UserPK pk), blah blha</STRONG></FONT></P>
<P><FONT size=2>user shouldnot update, create, delete itself. because it is not
Information Expert of itself. UserDAOFactory (as yours UserFactory) is
reponsible for User. </FONT></P>
<P><FONT size=2>This is only my opinion. if i am wrong, let me know and lead me
to right way.</FONT></P>
<P><FONT size=2>Bayarsaikhan VOLODYA</FONT></P>
<P><FONT size=2><FONT face=Arial color=#0000ff></FONT><BR><BR>// creating a new
user<BR>UserData data = // populate data<BR>UserFactory uf = // get user
factory<BR>User user = uf.create(data);<BR><BR>// Finding a user<BR>UserPK pk =
// populate user primary key<BR>UserFactory uf = // get user factory<BR>User
user = uf.findByPrimaryKey(pk);<BR><BR>// Updating a user<BR>UserData data = //
populate data from user input<BR>UserFactory uf = // get user factory<BR>UserPK
pk = // populate user primary key<BR>User user =
uf.findByPrimaryKey(pk);<BR>user.copy(data); // disallows modification of user
identity<BR>user.update();<BR><BR><BR>-- --Original Message-- --<BR>From:
Robert
Taylor [</FONT><A href="mailto:rtaylor@(protected)"><FONT
size=2>mailto:rtaylor@(protected)</FONT></A><FONT size=2>]<BR>Sent: Thursday,
August 26, 2004 2:55 PM<BR>To: J2EEPATTERNS-INTEREST@(protected)<BR>Subject:
Designing BusinessObjects (again) [Was Confusion with BusinessObject
implementations]<BR><BR><BR>Sorry for returning to this subject as I know I've
already posted<BR>about it but I've done a lot of reading and asking questions
and<BR>have worked through several implementations and think I have
finally<BR>come to a sound solution. I have a complete explanation along
with<BR>UML, ER diagram, and pseudo-code posted here:<BR><BR></FONT><A
href="http://bellsouthpwp.net/r/o/robertkaren6465/pages/java/bo/"
target=_blank><FONT
size=2>http://bellsouthpwp.net/r/o/robertkaren6465/pages/java/bo/</FONT></A><BR
><BR><BR><FONT
size=2>I'ld be very grateful for any feedback, comments or
constructive<BR>critigue and welcome any
questions.<BR><BR>robert<BR><BR>===============================================
=====================<BR>Companion
Site: </FONT><A href="http://www.corej2eepatterns.com" target=_blank><FONT
size=2>http://www.corej2eepatterns.com</FONT></A><BR><FONT size=2>J2EE
BluePrints: </FONT><A href="http://java.sun.com/blueprints/corej2eepatterns"
target=_blank><FONT
size=2>http://java.sun.com/blueprints/corej2eepatterns</FONT></A><BR><FONT
size=2>List Archive: </FONT><A
href="http://archives.java.sun.com/archives/j2eepatterns-interest.html"
target=_blank><FONT
size=2>http://archives.java.sun.com/archives/j2eepatterns-interest.html</FONT><
/A><BR><FONT
size=2>Unsubscribing: email "signoff J2EEPATTERNS-INTEREST" to
listserv@(protected)<BR></P></FONT></BODY></HTML>
====================================================================
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)

©2008 junlu.com - Jax Systems, LLC, U.S.A.