DAL和ORM之间的连线在哪里? [英] Where is the line between DAL and ORM?

查看:177
本文介绍了DAL和ORM之间的连线在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这些术语经常被交替地抛在脑后,显然有很大的重叠,但是似乎也常常暗示人们看到一个强烈的暗示,即一个系统是一个不被暗示为DAL的ORM。那是什么?如果有的话,区分这些类型的系统的要点是什么?



例如,假设我有一些实现数据库,表,列和行类的代码,通过对现有数据库的自动分析来填充它们,允许简化交互等。它了解,执行和利用数据库实体之间的结构关系,如外键。所有的实体模型都可以被子类化以将特定于表的功能加载到它们上。



DAL在多大程度上ORM在多大程度上?为什么?

解决方案

ORM =对象关系映射



ORM,应用程序中的类/对象映射到数据库表和持久性操作,有时是自动进行的。



DAL =数据访问层



在DAL中,数据库操作隐藏在代码外观后面。



ORM是一种DAL,但并不是所有的DAL都是ORM。


The terms are often thrown around interchangeably, and there's clearly considerable overlap, but just as often it seems implied that people see something strongly implied by saying that a system is an ORM that isn't implied by it being a DAL. What is that? What, if any, are the key points that differentiate these types of system?

For example, let's say I have some code that implements Database, Table, Column and Row classes, populating them by automatic analysis of an existing database, allowing simplified interaction and so on. It understands, enforces, and takes advantage of structural relationships between database entities, such as foreign keys. All the entity models can be subclassed to load table-specific functionality onto them.

To what extent is this a DAL? To what extent is it an ORM? Why?

解决方案

ORM = Object-Relational Mapping

In an ORM, classes/objects in the application are mapped to database tables and operations for persistence, sometimes automagically.

DAL = Data-Access Layer

In a DAL, database operations are hidden behind a code facade.

An ORM is a kind of DAL, but not all DALs are ORMs.

这篇关于DAL和ORM之间的连线在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆