Resources:
- Data access layer (DAL);
- Data access object (DAO): This article is about the data access object design pattern in object-oriented software design. In computer software, a data access object (DAO) is an object that provides an abstract interface to some type of database or persistence mechanism, providing some specific operations without exposing details of the database. It provides a mapping from application calls to the persistence layer. This isolation separates the concerns of what data accesses the application needs, in terms of domain-specific objects and data types (the public interface of the DAO), and how these needs can be satisfied with a specific DBMS, database schema, etc. (the implementation of the DAO).
- Active record pattern (named by Martin Fowler in his 2003 book "Patterns of Enterprise Application Architecture"), is an architectural pattern found in software that stores its data in relational databases. The interface to such an object would include functions such as Insert, Update, and Delete, plus properties that correspond more or less directly to the columns in the underlying database table. Active record is an approach to accessing data in a database. A database table or view is wrapped into a class. Thus, an object instance is tied to a single row in the table. After creation of an object, a new row is added to the table upon save. Any object loaded gets its information from the database. When an object is updated the corresponding row in the table is also updated. The wrapper class implements accessor methods or properties for each column in the table or view. This pattern is commonly used by object persistence tools, and in object-relational mapping. Typically, foreign key relationships will be exposed as an object instance of the appropriate type via a property.
- List of object-relational mapping software (e.g. for .NET: ADO.NET Entity Framework; LINQ to SQL; NHibernate; others...);
- Object-relational mapping: Object-relational mapping (ORM, O/RM, and O/R mapping) in computer software is a programming technique for converting data between incompatible type systems in object-oriented programming languages. This creates, in effect, a "virtual object database" that can be used from within the programming language. There are both free and commercial packages available that perform object-relational mapping, although some programmers opt to create their own ORM tools.
Discussions
- Is ORM (Linq, Hibernate…) really that useful?
- ORM vs Handcoded Data Access Layer
- Data access : Fluent Nhibernate vs ADO.NET vs Linq to Sql ?
Definition
A data access layer (DAL) 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.
For example, the DAL might return a reference to an object (in terms of object-oriented programming) complete with its attributes instead of a row of fields from a database table. This allows the client (or user) modules to be created with a higher level of abstraction. This kind of model could be implemented by creating a class of data access methods that directly reference a corresponding set of database stored procedures. Another implementation could potentially retrieve or write records to or from a file system. The DAL hides this complexity of the underlying data store from the external world.
For example, the DAL might return a reference to an object (in terms of object-oriented programming) complete with its attributes instead of a row of fields from a database table. This allows the client (or user) modules to be created with a higher level of abstraction. This kind of model could be implemented by creating a class of data access methods that directly reference a corresponding set of database stored procedures. Another implementation could potentially retrieve or write records to or from a file system. The DAL hides this complexity of the underlying data store from the external world.
No comments:
Post a Comment