  | 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
|
|
|
  | | | data update best practices | data update best practices 2004-04-21 - By Guy Katz
Back thanks. as far as i know. sun did not use any of the methods you suggested. in the petstore, the VOs generation come from the entity beans and hold all the bean's attributes. the user/password attributes are the only attributes of the user EJB and not a custom VO. did i miss what you were trying to say?
-- --Original Message-- -- From: Ovidiu Pitic [mailto:OvidiuP@(protected)] Sent: Wednesday, April 21, 2004 12:39 PM To: J2EEPATTERNS-INTEREST@(protected) Subject: Re: data update best practices
The accepted solution is to use custom value objects that hold only the changed data. For example, if only the user name is changed for a user VO, use a CVO (or CTO) that has only userId and userName as fields. For more info, see Sun's demo apps.
The business object will be responsible of updating only the changed values (in overloaded method that accepts a certain custom VO as parameter).
For complex functionality (which require tens of CVOs), use the dirty mechanism, as it will add insignificant overhead.
Regards, Ovidiu
-- --Original Message-- -- From: Guy Katz [ mailto:gkatz@(protected) <mailto:gkatz@(protected)> ] Sent: Wednesday, April 21, 2004 13:13 To: J2EEPATTERNS-INTEREST@(protected) Subject: Re: data update best practices
hi; maybe i wasnt so clear on my intention.
my dilema is choosing between the foolowing options: 1. application client updates small amount of attributes on my VO -> send it
to the EJB facade -> EJB layer sets all attributes of the VO on the corresponding domain object/s 2. 1. application client updates small amount of atributes on my VO -> send it to the EJB facade -> EJB layer layer sets only changed attributes on corresponding domain object/s.
option number 1 is trivial but has overhead of updating all the VO attributes back to the domain model. options 2 is requires a ' dirty attribute mechanism' which is extra code but
can increase performance.
any sugegstions? know practices for this? thanks.
-- --Original Message-- -- From: Aaron Tubman [ mailto:aharon@(protected) <mailto:aharon@(protected)> ] Sent: Wednesday, April 21, 2004 12:03 PM To: J2EEPATTERNS-INTEREST@(protected) Subject: Re: data update best practices
I suggest to update all the VO fields. In such way you can reuse the same code in different situations while overhead of DB update and object transfer is minor.
Aaron
-- --Original Message-- -- From: An interest list for Sun Java Center J2EE Pattern Catalog
==================================================================== 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)
|
|
 |