Question About Web App Architecture

Posts   
 
    
Wade
User
Posts: 76
Joined: 15-Jun-2004
# Posted on: 06-Dec-2004 20:26:42   

I am wondering what is the best way to use LLBLGen with the web. Do most of you generate a the DAL then create a Business Layer on top of that then the Web Presentation Layer on top of that? Or do you gen the DAL then bind and use directly in the Web Presentation Layer?

If you do create the Business Layer, do you gen different DALs for different Business Layers? Examples:

DAL: User, Role, UserRole, Personalization BLL: Membership

DAL: ShoppingCart, Order, OrderDetails, Product, OrderProducts, Discount, Product Discounts, etc..... BLL: Shopping

Another question: If you do create a BLL then what do you use to bind to a grid, the entity or a datatable/dataview? Also, in the scenario of a TypedList of TypeView?

Thanks for any and all feedback!

Wade confused confused

netLearner
User
Posts: 150
Joined: 18-Oct-2003
# Posted on: 06-Dec-2004 23:24:07   

For reporting/analysis purposes it is better to use DataTables/DataSets, for transaction processing it is better to use entities and business objects (more OOP). For a straight forward/simple project do not have seperate layers otherwise have seperate layers in the long run it will turn out to be useful.

::Another question: If you do create a BLL then what do you use to bind to a grid, the ::entity or a datatable/dataview? Also, in the scenario of a TypedList of TypeView?

If you have a entitycollection in hand already then you can bind it and avoid another trip to DB for a DataTable/set.

Thanks.

Wade
User
Posts: 76
Joined: 15-Jun-2004
# Posted on: 07-Dec-2004 15:36:40   

Anyone else have any other thoughts?

Thanks, Wade

Fishy avatar
Fishy
User
Posts: 392
Joined: 15-Apr-2004
# Posted on: 07-Dec-2004 17:23:38   

I've always made a BL to call llbl dal routines. For that Bl I have returned arraylists and datatables. But, I've also returned entitycollections all the way up to the pl. This is extremly convenent and since I always use the adapter version, I know the only way to affect the database is thru bl calls. simple_smile simple_smile

Hope this helps,

Fishy

jeffreygg
User
Posts: 805
Joined: 26-Oct-2003
# Posted on: 07-Dec-2004 21:24:21   

Wade wrote:

I am wondering what is the best way to use LLBLGen with the web. Do most of you generate a the DAL then create a Business Layer on top of that then the Web Presentation Layer on top of that? Or do you gen the DAL then bind and use directly in the Web Presentation Layer?

I think generating a business layer is always a good idea, except perhaps in prototyping. Having a BL allows you at the very least to intercept calls to the database to do validation, business rule checking, etc. It also gives you the most flexibility in how you package data to ship to the PL.

If you do create the Business Layer, do you gen different DALs for different Business Layers? Examples:

DAL: User, Role, UserRole, Personalization BLL: Membership

DAL: ShoppingCart, Order, OrderDetails, Product, OrderProducts, Discount, Product Discounts, etc..... BLL: Shopping

I would say it depends on your needs. If you have political/ownership issues where your team is split along functionality instead of layer it might be a good idea. However, I think in general that splitting the DAL along those kinds of lines would be adding a lot of unecessary work .

Another question: If you do create a BLL then what do you use to bind to a grid, the entity or a datatable/dataview? Also, in the scenario of a TypedList of TypeView?

Alot depends on your needs. You'll need to take a look at things like your memory footprint and network utilization/response time requirements. Using entity collections to bind to grids and such can result in a lot of unnecessary data being brought over the wire and stored in memory. If you have large entities and/or large collections then it may behoove you to work out a way to fetch only the required columns for each grid you're working with.

The problem, of course, is that working with datatables is a lot less convenient than working with entity collections. There's also the problem of sometimes having to convert between entities and datarows.

The rule of thumb I use is that if I'm going to be simply displaying data in a grid (as opposed to working with each entity in the collection) then I will use the Dynamic Lists functionality in a Factory pattern to fetch only the columns I need to display. It's a matter of balancing memory/network usage versus a little extra work.

My $.02...

Jeff...

kulki
User
Posts: 26
Joined: 20-Dec-2004
# Posted on: 20-Dec-2004 23:43:50   

well I use Crystal Reports a lot. And as far as I know it only supports DataSets and not collection of entities. Is this really true? Anyone tried to create reports with collection of entities?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39752
Joined: 17-Aug-2003
# Posted on: 21-Dec-2004 10:23:21   

the designer of CR works with datasets only. But the architecture should work with entity collections just fine. (i.e. design with a dataset, then bind a collection at runtime)

Frans Bouma | Lead developer LLBLGen Pro