Using Data Transfer Object to Handle Long Business Transactions on a Domain Model (PofEAA)

From: Shane Mingins (shanemingins_at_yahoo.com.clothes)
Date: 10/29/03


Date: Wed, 29 Oct 2003 15:39:44 +1300

Hi

I have been reading through parts of PofEAA and I am wondering about the use
of Data Transfer Object(401) in my senario.

The essence of what I have been trying to understand is how to handle a long
business transaction and isolate changes to the Domain Model(116) so that
the Domain Model is correct (correct in that it is not showing the results
of a partially completed business transaction).

An application interation involves the user performing editing functions on
an complex object (I'll call this a master object) from the Domain Model
where the editing involves adding/editing/deleting other objects (and I'll
call these detail objects) and the business transaction is completed when
the user selects to save the master object

Now on one hand I am told that the View (UI) should reflect changes to the
Model (and I have been generally been equating that to the Domain Model).
But if the Domain Model reflects actions performed on the detail objects or
an add/delete of a detail object before user saves the master object, then
the Domain Model would be incorrect.

If my understanding is okay, then my goal is isolate the changes to the
Model from anyone else until the master object is saved.

So is the Data Transfer Object pattern the answer? In which case my Model
becomes a Data Transfer Object pattern. The Views will update from the
changes in this Model and the Domain Model is only updated when the master
DTO (equating to the master object in the Domain Model) is saved.

OR, is there some other way to isolate the concurrency issues of a long
business transaction on a Domain Model?

Thanks
Shane

-- 
shanemingins@yahoo.com.clothes
remove clothes before replying
"It is not the strongest of the species that survive, nor the most
intelligent, but the one most responsive to change." --- Charles Darwin


Relevant Pages