2.1. Problem

The goal of the DAL is to create classes that expose methods that enable the business layer to retrieve or persist data to the database. The DAL should not communicate directly with the user interface, although it is tempting when you can easily bind DataSets and DataReaders to a GridView or other bound controls. The diagram shown in Figure 2-1 demonstrates a typical three-layered architecture. The user interface layer is the layer that interacts with the user. This could be via a web browser, a Windows Forms application, a mobile application, and so on.

Figure 2.1. Figure 2-1

This book concentrates on building a web application. The user interface will be comprised of Web Forms, custom controls, server controls, and JavaScript. Chapter 4 goes into more detail about the user interface, but the key concept here is understanding that one of the goals of a three-layered architecture is to separate the logic from the presentation so that you can divide development in each layer to draw on a particular developer's strengths. UI developers have a keen sense for colors, fonts, layout, and the overall user experience. Correctly structured, an application can transform its appearance depending on the browser or device being used to display the application. The only layer the UI interacts with is the business logic layer.

The business logic layer (BLL) contains the brains ...

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.