Chapter 6. The Data Access Layer

High thoughts must have a high language.

—Aristophanes

The data access layer (DAL) is a library of code that provides access to data stored in a persistent container, such as a database. In a layered system, you delegate to this layer any task that relates to reading from, and writing to, the persistent storage of choice.

No matter how many abstraction layers you build in your model, at some point you need to open a connection to some database. That’s where and when the DAL fits in. Over the years, a few patterns have been devised to design a DAL that is efficient and extensible. This chapter covers a number of these patterns.

It is key to note that the concept of a DAL is a bit nebulous. The idea of a DAL is ...

Get Microsoft® .NET: Architecting Applications for the Enterprise 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.