Resultset projection vs. Read thru IDataReader

Posts   
 
    
Posts: 7
Joined: 21-Jul-2008
# Posted on: 17-Dec-2008 00:58:39   

Hi,

I'm using LLBL 2.6 in our new project and are working on the transformation from LLBL generated code (Self-Servicing) to our customized objects.

Currently I'm considering between: 1. Resultset projection: define ResultsetFields, create DataProjectorToCustomClass list then execute dao.GetAsProjection. Basically pretty close to the example in LLBL documentation (http://www.llblgen.com/documentation/2.6/Using%20the%20generated%20code/SelfServicing/gencode_datareadersprojections.htm#resultsetprojections) Or 2. Manual transformation: write the retrieval stored procedure in DB, execute dao.GetAsDataReader, loop through the IDataReader object, call the constructor of our customized object then add the object to List<object>

Both work fine but I wonder if any of you have any experiences about performance between these two? Any recommendation on which one should I use?

Our test data is small the potentially the data can be really huge (thousands of record per result set).

Any idea is appreciated

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 17-Dec-2008 03:32:16   

the way I see it if you use projections you would be saving lots of time but if you choose the manual path you'll gain more control.

David Elizondo | LLBLGen Support Team
Posts: 7
Joined: 21-Jul-2008
# Posted on: 17-Dec-2008 17:08:54   

daelmo wrote:

the way I see it if you use projections you would be saving lots of time but if you choose the manual path you'll gain more control.

Not sure what kine of time saving you're talking about because the way I see it, I still have to type a lot of resultset fields .... ALso if there's change on the DB structure (add/edit column) later, I still have to manually update the projection code.

Any idea on performance?

Walaa avatar
Walaa
Support Team
Posts: 14993
Joined: 21-Aug-2005
# Posted on: 18-Dec-2008 09:37:54   

IMHO, no performance difference would be detected, although I thik the manual way should be faster.

What exactly does your custom classes do? what purpose do they serve?

Posts: 7
Joined: 21-Jul-2008
# Posted on: 18-Dec-2008 18:17:04   

Walaa wrote:

IMHO, no performance difference would be detected, although I thik the manual way should be faster.

What exactly does your custom classes do? what purpose do they serve?

My custom classes serve as an extra layer on top of DAL, so we can easily switch between database entities (LLBL) to web service entities, if needed. Our biz logic only deals with these classes, not data entity classes. Anyway, since projection does not have any significant advantages, I'll go with manual, for better control.

Thanks guys,