Chan Chen Coding...

          DAL

          data access layer (DAL) in computer software, is a layer of a computer program which provides simplified access to data stored in persistent storage of some kind, such as anentity-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, instead of using commands such as insertdelete, and update to access a specific table in a database, a class and a few stored procedures could be created in the database. The procedures would be called from a method inside the class, which would return an object containing the requested values. Or, the insert, delete and update commands could be executed within simple functions like registeruser or loginuser stored within the data access layer.

          Also, business logic methods from an application can be mapped to the Data Access Layer. So, for example, instead of making a query into a database to fetch all users from several tables the application can call a single method from a DAL which abstracts those database calls.

          Applications using a data access layer can be either database server dependent or independent. If the data access layer supports multiple database types, the application becomes able to use whatever databases the DAL can talk to. In either circumstance, having a data access layer provides a centralized location for all calls into the database, and thus makes it easier to port the application to other database systems (assuming that 100% of the database interaction is done in the DAL for a given application).

          Object-Relational Mapping tools provide data layers in this fashion, following the active record model. The ORM/active-record model is popular with web frameworks.



          -----------------------------------------------------
          Silence, the way to avoid many problems;
          Smile, the way to solve many problems;

          posted on 2012-07-13 06:41 Chan Chen 閱讀(311) 評論(0)  編輯  收藏 所屬分類: Architecture

          主站蜘蛛池模板: 南昌市| 镇坪县| 东光县| 吴川市| 宁德市| 西城区| 陆河县| 苍南县| 仁布县| 靖江市| 县级市| 衡东县| 隆安县| 疏附县| 土默特右旗| 五寨县| 榕江县| 惠水县| 宝坻区| 长子县| 休宁县| 尼玛县| 凭祥市| 乐昌市| 枣阳市| 霍林郭勒市| 赣州市| 清徐县| 砚山县| 宜章县| 柏乡县| 泸定县| 安义县| 禄丰县| 浦东新区| 昆明市| 卓资县| 博爱县| 独山县| 同心县| 深泽县|