Object oriented vs. object relational database difference
Asked Answered
E

2

13

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?

Ethnomusicology answered 15/6, 2014 at 23:41 Comment(0)
P
12

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.

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.

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

Police answered 16/6, 2014 at 0:0 Comment(2)
Q 1: In OO model the database still uses concept of tables? Q 2: What about the objects having certain method. Are there accessors and modifier methods ( I read that all attributes are encapsulated) as well as method like getPricer() which would first calculate price and then return it? Q3: What is an example of interface for OO databases?Ethnomusicology
In OO model it does not call it tables but classes. Not every OO database has this notion.; The database stores data, not code. If you retrieve an object instance that happens to have methods defined then those methods will be available on that object. If you change the methods available through recompilation the new methods will be available on the next program run.; db4o is an example project that I have used. db4o.comPolice
T
4

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.

Trait answered 28/1, 2016 at 18:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.