gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-30 01:42:19 27 4
gpt4 key购买 nike

能否请您用 PHP 解释以下数据库代表之间的区别:

对象关系管理道数据映射器事件记录表网关

任何示例将不胜感激。

最佳答案

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

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.

关于php - ORM/DAO/DataMapper/ActiveRecord/TableGateway 的区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3198419/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com