Advantages of serializing UnitOfWork2 rather than entityToSave (where the save is recursive)

Posts   
 
    
saggett
User
Posts: 50
Joined: 12-Nov-2007
# Posted on: 10-Jul-2008 14:58:39   

At the moment I'm engaged in carrying out a lot of work to improve response times in our WCF / LLBLGen Adapter based WinForms thin client application (which has service methods such as void SaveCustomer(CustomerEntity customer) etc. ). I'm thinking of switching to using a custom binary serialization implementation for WCF in order to take advantage of the far smaller message sizes but also the fact that UnitOfWork2.OptimizedSerialization = true allows one to serialize just the unitofwork queues that were generated from a big entity graph (with both clean entities and dirty entities).

So as a result:

work.AddForSave(customer, true); ServiceEndPoint.CommitUnitOfWork(work);

would be far more performant (i.e. the message size is smaller) than doing

ServiceEndPoint.SaveCustomer(customer); then doing the usual adapter.SaveEntity(customer, true) .

So am I correct in thinking that remoting / any implementation using BinaryFormatter to serialize llblgen entities and UnitofWork2 instances not only gives a smaller message size, but allows one send only the data required for the db inserts and updates over the wire, rather than the entire graph?

swallace
User
Posts: 648
Joined: 18-Aug-2003
# Posted on: 10-Jul-2008 15:26:49   

I have a love/hate relationship with that word 'Performant'. It's perfect, but not a real word. We should start a petition to get it upgraded.

http://www.urbandictionary.com/define.php?term=Performant

saggett
User
Posts: 50
Joined: 12-Nov-2007
# Posted on: 10-Jul-2008 15:40:47   

Care to propose an alternative word?

Walaa avatar
Walaa
Support Team
Posts: 14946
Joined: 21-Aug-2005
# Posted on: 10-Jul-2008 15:41:36   

BEST thing: call the service with the action to take and only send the entities required over (for example in a message). WCF can't use unitofwork, it's not XML serializable.

Remoting a unitofwork isn't optimal either, although it does cut off trees which aren't referenced by dirty entities, however objects which are referenced by dirty entities are serialized as well, so this isn't optimal at the moment.

We will try to further investigate in this point in the near future but we can't promise anything.