Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » J2EE Pattern »

Re: data update best practices

Guy Katz

2004-04-21


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)]
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
[mailto:J2EEPATTERNS-INTEREST@(protected)
Sent: Wednesday, April 21, 2004 11:44 AM
To: J2EEPATTERNS-INTEREST@(protected)
Subject: data update best practices


hi all;
i have a situation where i pass a value object to a client. the client
will usually need to modify 1 or 2 attributes on the VO (which has many
attributes). i need to submit the changes back to the server. what i
havnt decided is if its valid to update all my data according to the
'new VO' (which is my old VO with minor changes) or just update the
fields that have chaned. in order to update the fields that have
changed, i need to add flags to indicate dirty attributes and i dont
know if i like it architecture wise.

are there any patterns for such updates?
thanks.

____________________
Guy Katz
Allot Communications
gkatz@(protected)
tel: +972 9 7619288
fax: +972 9 7443626

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

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

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