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...