Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DAL and BLL in .NET

There is this DAL/BLL design suggestion by Microsoft for ASP.NET (2.0) apps. I know some of the alternatives and I've read related questions here on SO. However I wonder if this proposed solution is worth implementing nowadays, is there a specific downside you know of?

I want to develop DAL/BLL components for company-internal use, to access customer and employee data, etc from various applications and scripts. However before I start building that stuff, I want to be sure that this solution is 'good'. As example, the BLL passes datatables instead of encapsulating anything, you don't have isolated business objects that contain logic. It's basically only a dumb layer that eases the CRUD operations a bit and allows databinding for controls.

Could someone, who has experience in this field, point me out the pro's and con's of this approach?

like image 517
driAn Avatar asked Jan 17 '09 10:01

driAn


People also ask

What is .NET DAL?

A data access layer (DAL) in computer software is a layer of a computer program which provides simplified access to data stored in persistent storage of some kind, such as an entity-relational database. This acronym is prevalently used in Microsoft environments.

What is BLL C#?

In this article In this tutorial we'll see how to centralize your business rules into a Business Logic Layer (BLL) that serves as an intermediary for data exchange between the presentation layer and the DAL.

What is net BLL?

Netball is a ball sport played by two teams of seven players, usually on an indoor court, and is predominantly played by women. It is among a rare number of sports which have been created exclusively for the female sex, although efforts to expand the game to mixed and men's teams now exist.

What is DAL and BAL in C#?

BAL = Business Application Layer. DAL = Data Access Layer.


1 Answers

I fully recommend NOT USING DATATABLES. Look into a domain driven design implementation that your entire framework will work with regular objects that you can pass into List<> or Queryable<>. DataTables are garbage that shouldn't even be included in .NET anymore.

I would also recommend looking into using a Dependency Injection / Inversion of Control framework such Microsoft Unity or StructureMap to create loosely coupled code.

like image 155
Chris Marisic Avatar answered Oct 07 '22 04:10

Chris Marisic