ORM 和 ODM 有什么区别? [英] What is the difference between an ORM and an ODM?

查看:28
本文介绍了ORM 和 ODM 有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图弄清楚 ORM 和 ODM 之间的区别是什么,据我了解的概念,ORM(对象关系映射器)映射数据之间的关系,而 ODM(对象文档映射器)处理文档.我是否正确地假设 mySQL 是 ORM 的一个例子而 MongoDB 是 ODM 的一个例子?

I am trying to figure out what the difference is between ORM and ODM, as far as I understand the concept, ORM (Object Relational Mapper) maps the relations between data, where as ODM (Object Document Mapper) deals with documents. Am I right in assuming that mySQL is an example of ORM and MongoDB is a example of ODM?

我相信你已经看到了,我不太熟悉这个概念的理论.有人可以澄清一下两者之间的区别吗?

As I am sure you can see, I am not too familiar with the theory of the concept. Could someone please clarify the differences between the two?

推荐答案

MySQL 是关系数据库的一个示例 - 您将使用 ORM 在代码中的对象和数据的关系表示之间进行转换.

MySQL is an example of a relational database - you would use an ORM to translate between your objects in code and the relational representation of the data.

ORM 的示例是 nHibernate实体框架精致等等...

Examples of ORMs are nHibernate, Entity Framework, Dapper and more...

MongoDB 是文档数据库的一个示例 - 您可以使用 ODM 在代码中的对象和数据的文档表示(如果需要)之间进行转换.

MongoDB is an example of a document database - you would use an ODM to translate between your objects in code and the document representation of the data (if needed).

Mandango 是 MongoDB 的 ODM 示例.

Mandango is an example of an ODM for MongoDB.

这篇关于ORM 和 ODM 有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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