Chapter 3. Designing the Business Logic Layer

The business logic layer (BLL) in the three-layered architecture is really the brains of your application. It is here that you model the business process defined by the user and enforce validation rules to protect the integrity of the data. The BLL sits between the user interface and the DAL. Technology is constantly changing and there are always new ways of presenting data to the user, such as with AJAX, Silverlight, or even your phone, but the business rules for your application remain the same regardless of the user interface. The design of the BLL should be flexible enough that any type of front end can use it, even a Windows service.

Depending on the size and budget of your application, the database could start out as Access but eventually migrate to SQL Server or Oracle. Again, the business rules do not change based on the database, so all the business rules should be separated from the data access code. If you were to put your business rules in stored procedures or Oracle packages, then you would be married to that database. Changing databases becomes quite a daunting task. If a database is used simply as a place to store the data, then changing databases is much easier.

To successfully develop an application that can easily work with multiple user interfaces or multiple databases, you should model your business process and place all your validation rules in the business logic layer. A BLL typically consists of classes that ...

Get ASP.NET 3.5 Enterprise Application Development with Visual Studio® 2008: Problem - Design - Solution now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.