ORM/DAO/DataMapper/ActiveRecord/TableGateway 的区别?

ORM/DAO/DataMapper/ActiveRecord/TableGateway differences?(ORM/DAO/DataMapper/ActiveRecord/TableGateway 的区别?)
本文介绍了ORM/DAO/DataMapper/ActiveRecord/TableGateway 的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

能否请你解释一下以下数据库代表之间的区别,比如在 PHP 中.

ORM道数据映射器活动记录表格网关

如有任何示例,我们将不胜感激.

解决方案

这需要一个很长的答案.我没有在我面前重复别人说得更好更详细的内容,而是将您链接到一些相关页面.我建议仔细查看它们.也许遵循一些额外的链接.维基百科总是一个好的开始.如果您在浏览链接后仍然对一种或另一种模式有任何疑问,请随时返回 SO 并再次提问.但是,如果您这样做了,请尝试缩小范围.提出多个问题并专注于特定方面比期望人们为您写文章要好.

对象关系映射器

<块引用>

计算机软件中的对象关系映射(ORM、O/RM 和 O/R 映射)是一种编程技术,用于在关系数据库和面向对象的编程语言中不兼容的类型系统之间转换数据.

数据访问对象<块引用>

使用数据访问对象 (DAO) 来抽象和封装对数据源的所有访问.DAO 管理与数据源的连接以获取和存储数据.

DataMapper

<块引用>

一层映射器 (473),用于在对象和数据库之间移动数据,同时保持它们彼此独立以及映射器本身.

活动记录

<块引用>

在数据库表或视图中包装一行、封装数据库访问并在该数据上添加域逻辑的对象.

表数据网关

<块引用>

充当数据库表网关 (466) 的对象.一个实例处理表中的所有行.

Can you, please, explain me the differences between the following database representatives, say, in PHP.:

ORM DAO DataMapper ActiveRecord TableGateway

Any examples would be appreciated.

解决方案

That would require a pretty long answer. Instead of repeating what others have said better and in more detail before me, I link you to some relevant pages. I suggest to look through them. Maybe follow a few additional links. Wikipedia is always a good start. If you still have any questions about one or the other pattern after going through the links, feel free to come back to SO and ask again. But if you do, try to narrow it down. It's better to ask multiple questions and focus on particular aspects than expecting people to write an essay for you.

Object Relational Mapper

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 relational databases and object-oriented programming languages.

Data Access Object

Use a Data Access Object (DAO) to abstract and encapsulate all access to the data source. The DAO manages the connection with the data source to obtain and store data.

DataMapper

A layer of Mappers (473) that moves data between objects and a database while keeping them independent of each other and the mapper itself.

Active Record

An object that wraps a row in a database table or view, encapsulates the database access, and adds domain logic on that data.

Table Data Gateway

An object that acts as a Gateway (466) to a database table. One instance handles all the rows in the table.

这篇关于ORM/DAO/DataMapper/ActiveRecord/TableGateway 的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)