Filtering on Collection of Business Object At DataPortal_Fetch

Filtering on Collection of Business Object At DataPortal_Fetch

Old forum URL:

st3fanus posted on Monday, January 11, 2010


I want to share about my decision on DataPortal_Fetch, I'll tell about my scenario below :

I want to display a collection of my ReadOnlyBO called CustomerInfo, to reduce the amount of CustomerInfo record for display ( it' means reduce memory ). I want to filter using several UI control.

My decision is :
1. I used a StoreProc to accept values from several UI control, and I doing filterization inside store proc, so that DataPortal_Fetch only receive requested records.

My Question are :
1. Are there any another better ways to doing this ?
2. Which is better doing filterization on Store Proc as i have done or Doing it on DataPortal_Fetch ?

Thanks a lot for anything respond for my posting


meaningoflights replied on Monday, January 11, 2010

There willl be less network traffic if you filter (using a WHERE clause) in your stored proc and a reduced recordset will be lighter on memory.

We are caching all the objects received from the database and this strategy might make sense for you too, to cache all the Customers and then filter them using .net code, but this will increase memory consumption.

Depends if the goal is to use reduce memory and network traffic or to aquire a bit more speed?


ajj3085 replied on Tuesday, January 12, 2010

I would do the filtering at the database level; let the database do what it does best, process large sets of data.

Just make sure that you're passing the criteria through the normal Csla route; via a static factory method which takes the criteria (or maybe a criteria object) and your DP_F knows how to take those values and plug them into the stored procedure call.

st3fanus replied on Wednesday, January 13, 2010


Thanks meaningoflights and ajj3085

I'm appreciate about your "sharing" :)

Thanks a lot


Copyright (c) Marimer LLC