Typed Lists vs. Type Views...

Posts   
 
    
jnong
User
Posts: 9
Joined: 02-Feb-2007
# Posted on: 07-Jul-2007 01:35:31   

I need some clarification on the difference between a Typed List and a Typed View. Documentation says that a Types List "is a list of entity fields from a set of entities which have 1:1, 1:n or m:1 with each other". That sounds like the standard concept of a database view. So then what more is a Typed View?? Any examples of when I should use each type would be very helpful. Thanks.

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 07-Jul-2007 02:31:30   

TypedView = Database View TypedList = like a strongly DataTable. LLBL wraps the table creating strongly typed columns DynamicList = DataTable

Personally I try to avoid TypedViews as I feel this blurs the line between the business logic and data access. Sometimes they are unavoidable, because of the data schema and information required.

TypedLists are defined at design time and DynamicLists are designed at runtime.

Posts: 1
Joined: 27-Nov-2007
# Posted on: 27-Nov-2007 13:22:24   

mmm! thats a personal perference, but can you please give a solid reason that why one should use TypedLists than TypedViews, as both looks almost same except one is generated at LLBLGen designer and other at Database. There must be a reason, like performance or Predicate etc.

Thanks

jmeckley
User
Posts: 403
Joined: 05-Jul-2006
# Posted on: 27-Nov-2007 15:10:16   

i'm not suggesting that one is better than the other. That can only be determined based on the requirements of the project. If i have the choice I prefer to build aggregated object via typed list instead of views.

In my mind this better seperates responsibility. I want my database to store data, not much more than that. so any aggregation of that information I want to define in my model via typed/dynamic lists. I could just as well define the aggration within a db view and map the view to a typedview or read-only entity. again, just preference.

As for preformance of a typedlist over a typedview. The milliseconds gained from one over the other is negledgable(sp). Usually preformance is gained with better connection management and sql statements. connections are handled by the DataAccessAdapter (adapter template) which effects both views and typed lists. The sql statement itself can be generated via code, or defined by a view/stored proc. again either way the sql will be executed. I don't believe where the sql is generated will cause a significant preformance gain for a majority of systems. granted in extreme edge cases and large databases (100's of millions of records) this may play into the equation, but most developers aren't working on systems this big.

goose avatar
goose
User
Posts: 392
Joined: 06-Aug-2007
# Posted on: 27-Nov-2007 16:41:54   

I agree with jmeckley.

The most easy way to explain is: when you work with someone else's databases i.e. you don't have the chance to design it yourself and there is a bunch of database views your are required to use, and there is no time to rewrite them from scratch as a dynamic list or TypedList. Or maybe you are force it to use them due some strange/random/bureaucratic requirement.

Bottomline: TypedViews are generated from existing views in a existing database. TypedLists are manually created from the LLBLGenPro designer. DynamicLists are created from code and because of that offer more flexibility.