March 16, 2003

Building a Robust DAL

Goals for Building a Robust Data Access Layer

• Security
• Data Integrity – Code should mange constraints, errors are handled in a useful way before it get to the database.
• Transactional Integrity – Follows ACID properties—Atomic, Consistent, Isolated, and Durable
• Concurrency Integrity - Prevent multiple users from changing a record at the same time.
• Error Handling
• Maintainability - Centralize code

• Object to Relational Mapping
Traditional recordset has limitation on flexibility on database types. By creating classes with typed properties that mapped to specific fields in database entities can solve this problem. This is called Object to Relational mapping. In this model, there are typically
> Entity objects - a single record or row from a database resultset.
> List Objects - either a collection of entity objects or a tabular list of data from a resultset.
> Handler Objects – framework for loading entity and list objects.