comparision between EntityBase & DataSet or DataTable

Posts   
 
    
vairam2008
User
Posts: 86
Joined: 11-Mar-2008
# Posted on: 30-Mar-2008 22:33:55   

I am trying to crystalize on whether to build DTO's or just use Entities where I have to transfer data. Hence I have this question. Is EntityBase comparitively heavily functionality loaded as compared to DataSet. What is the benefit of using EntityBase->MyTableEntity over Typed DataSet?

What is the performance hit of using directly using Entities for transfering data from client to server considering I am transfering a graph of 15 tables each having at least one record & few tables having 15 records at a time for update & I am sending only the dirty records?

What is the difficulties & one should consider if I choose DTO?

Is there an FAQ for these kind of architecture issues that one should consider while developing using GenPro.

Thanks

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 31-Mar-2008 10:22:21   

conceptually, an entity is a separate, individual unit. A datatable is a flat list of data, each row is tied to the table it's in, it's not a separate unit.

If you distribute data over the wire, the biggest bottleneck is the layer which provides the transportation of the data and rebuilding the objects for you. If you use remoting, you can use our fast-serialization feature which provides very fast serialization (much faster than .NET's binary formatter) and very compact datablocks. This also has the advantage that you can send over unitofwork objects, predicates etc.

If you use WCF or other XML based frameworks (don't let the marketing fool you: WCF is always XML, though it is sometimes compressed in binary form afterwards), the xml serialization pipeline is the bottleneck. LLBLGen Pro entities are also serializable to xml, though this is slower than fast-serialization, but faster than datatable xml serialization and also more compact in most situations, plus you get change tracking build in.

The DTO scenario can be of help if you build mature webservices which are standalone applications (which is the recommended way to build webservices anyway), and you then use DTO's as messages. You can then use .net's xml serialization code which generates C# behind the scenes to serialize/deserialize the objects.

Frans Bouma | Lead developer LLBLGen Pro