面向对象与对象关系数据库的区别

时间:2022-08-19 03:42:39

I have been reading about database models and still do not understand what are the fundamental differences between object oriented and object relational models.

我一直在阅读有关数据库模型的内容,但仍然不了解面向对象和对象关系模型之间的根本区别。

I learned so far that object relational database is a relational database also which supports objects. What makes object-oriented database different? (aside from not supporting relational model).

到目前为止,我了解到对象关系数据库是一个支持对象的关系数据库。是什么让面向对象数据库与众不同? (除了不支持关系模型)。

Is the difference also in object-oriented database giving the objects methods - behaviour (like in OO programming languages) while object-relational database only treats them as a structures with attributes and references to other objects? If so, how does one uses these object methods in OO databases?

面向对象的数据库是否也给出了对象方法 - 行为(如在OO编程语言中),而对象关系数据库只将它们视为具有属性和对其他对象的引用的结构?如果是这样,如何在OO数据库中使用这些对象方法?

2 个解决方案

#1


11  

The two kinds are quite similar: Classes map to tables. Columns map to fields. Instances map to rows. Object references map to foreign keys. In fact, ORMs try to map the two models as closely as possible. They are quite successful with that.

这两种非常相似:类映射到表。列映射到字段。实例映射到行。对象引用映射到外键。实际上,ORM尝试尽可能地映射这两个模型。他们非常成功。

The difference is mostly in the way the database is used. The difference is in "style" and in the patterns that are used.

差异主要在于数据库的使用方式。不同之处在于“风格”和使用的模式。

Object databases are basically used like you would use an ORM on top of a relational database. You can directly store objects (or object graphs) into the database without the need to write an INSERT statement. The interface is often not SQL.

基本上使用对象数据库就像在关系数据库上使用ORM一样。您可以直接将对象(或对象图)存储到数据库中,而无需编写INSERT语句。接口通常不是SQL。

It is hard to differentiate the two because they are so similar. Please leave a comment if you are interested in certain (concrete) aspects.

两者很难区分,因为它们非常相似。如果您对某些(具体)方面感兴趣,请发表评论。

#2


3  

In an object oriented model we will directly store the object into a DB, by using this method we can store the images, videos,audio into a DB. But in Object Relational DB we will store the data in the form of a relation and also in directly.

在面向对象模型中,我们将对象直接存储到数据库中,通过使用此方法,我们可以将图像,视频,音频存储到数据库中。但是在Object Relational DB中,我们将以关系的形式存储数据,也可以直接存储。

#1


11  

The two kinds are quite similar: Classes map to tables. Columns map to fields. Instances map to rows. Object references map to foreign keys. In fact, ORMs try to map the two models as closely as possible. They are quite successful with that.

这两种非常相似:类映射到表。列映射到字段。实例映射到行。对象引用映射到外键。实际上,ORM尝试尽可能地映射这两个模型。他们非常成功。

The difference is mostly in the way the database is used. The difference is in "style" and in the patterns that are used.

差异主要在于数据库的使用方式。不同之处在于“风格”和使用的模式。

Object databases are basically used like you would use an ORM on top of a relational database. You can directly store objects (or object graphs) into the database without the need to write an INSERT statement. The interface is often not SQL.

基本上使用对象数据库就像在关系数据库上使用ORM一样。您可以直接将对象(或对象图)存储到数据库中,而无需编写INSERT语句。接口通常不是SQL。

It is hard to differentiate the two because they are so similar. Please leave a comment if you are interested in certain (concrete) aspects.

两者很难区分,因为它们非常相似。如果您对某些(具体)方面感兴趣,请发表评论。

#2


3  

In an object oriented model we will directly store the object into a DB, by using this method we can store the images, videos,audio into a DB. But in Object Relational DB we will store the data in the form of a relation and also in directly.

在面向对象模型中,我们将对象直接存储到数据库中,通过使用此方法,我们可以将图像,视频,音频存储到数据库中。但是在Object Relational DB中,我们将以关系的形式存储数据,也可以直接存储。