Hi folks,

When handling objects in a typical CRUD MVC type web app (letâs say Apache 
Struts based app), most of us have went through the update problem.
The fact that web apps are "disconnected" and following the MVC paradigm 
,means the data, while in the browser is just that presentation data, adds 
a dimension batch processing or monolithically built apps do not  present.

Letâs say object A has a collection of object B (compound assoc., for 
example an Order -A- and itâs detail Line -B-).

In moment m1, The user Creates the Order and stores it temporary in order 
to review it later.
In moment m2, the user retrieve the Order (object class A) using some 
criteria, then he does some modifications in a few detail lines (object 
class B), then  delete some detail lines, and add a bunch of new ones.

Then he submit the changed Object A.
The "action" in the server, will then materialize the object once again, 
and some coding will update the object with the data received from the 
browser.

Question is: which is the best way to handle the dirty Object (A) and its 
collections of somehow dirty objects B.
Is there any well know pattern to to this? What if someone has changed the 
object while the user was doing his changes in the web?
Here weâve implemented different strategies, from deleting all existing 
childs and storing the new ones to sending hidden attributes with OIDs and 
dirty flags and writing some logic to handle the changes. But, I  fee we 
are not using some OJB capabilities that might do this for us.

Regards,
Gustavo.


Reply via email to