P of EAA-Unit of work,domain model and order of objects persistence

P of EAA-Unit of work,domain model and order of objects persistence

Post by tome » Sun, 20 Jul 2003 23:40:27



Hi,

My domain model contains about  25 types,
here is part of my domain model

User
--->AddressBook
------>Contacts
--------->Contact(B)
--->Messages
------>Contacts
--------->Contact(A)

Both contact Object are of the same type
Conatct(B) uses the 'Contact' Table,while Contact(A) uses a foreign
key
from the 'Contact' table

I am using the Data Mapper pattern for persistence

and i am considering to use also the Unit Of Work pattern
but i don't know how to ensure transaction management and data
integrity
I know that in some domain object's methods calls i need to call
Commit on the
unit of work ,and i believe i can identify those places ,but i am not
sure about
the order of persistence

note that i am keeping a one to one relationship between a contained
object
and it's container,objects are added using the following syntax

set ContainedObject=Container.Add Key,...

also i am using pseudo collection for large collection
in the above example Contacts belongs to the address book are pseudo
collection,
methods calls will be delegated to the data mapper to retrieve an
object from  from an identity map or a data base

Thanks in advance

Tomer