EntityCollection.FindMatches() vs EntityView2 for Application readonly Cache

Posts   
 
    
rracer99
User
Posts: 58
Joined: 11-Mar-2007
# Posted on: 01-Sep-2007 00:47:10   

Our scenario will require a large collection to be held in the application cache (asp.net Cache). The asp.net page must handle high loads, so it will be best to cache and retrieve relevant data in memory.

We have been storing the EntityCollection and doing FindMatches() per request to access the data. The data is used in a read-only capacity.

I have read about the EntityView2 Class as well.

Which is the better choice for our application? I am having trouble seeing the benefit from EntityView2, but do not understand its purpose fully. Are not both options working in-memory? Are they comparable for read-only performance in the above scenario?

Thank you

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 01-Sep-2007 06:24:03   

rracer99 wrote:

Which is the better choice for our application? I am having trouble seeing the benefit from EntityView2, but do not understand its purpose fully. Are not both options working in-memory? Are they comparable for read-only performance in the above scenario?

LLBLGenPro wrote:

The purpose of an EntityView2 is to give you a 'view' based on a filter and / or a sortexpression on an in-memory EntityCollection. Which data contained in the related EntityCollection is available to you through a particular EntityView2 object depends on the filter set for the EntityView2. In which order the data is available to you is controlled by the set sort expression. As the related collection is not touched, you can have as many EntityView2 objects on the same EntityCollection, all exposing different subsets of the data in the EntityCollection, in different order.

If you are manipulating the FindMatches only to read-only intention and to retrieve a subset based on a filter I think you should use EntityView2, so you could:

  • Create in-memory views on an EntityCollection object (generic or non-generic) and allows you to filter and sort an in-memory EntityCollection without actually touching the data inside the EntityCollection

  • As the related collection is not touched, you can have as many EntityView2 objects on the same EntityCollection, all exposing different subsets of the data in the EntityCollection, in different order.

For more info read LLBLGenPro Help - Using the generated code - Using entity views with entity collections.

David Elizondo | LLBLGen Support Team