2. Content
• Merging relational and object models
• Why ORDBMS?
• What is ORDBMS?
• Stonebreaker’s view
• Advantages and disadvantages of ORDBMS
• Object-Relational Operations
• Object-Relational Mapping
2
3. Merging Relational and Object Models
Object-oriented models support interesting data types --- not
just flat files.
– Maps, multimedia, etc.
The relational model supports very-high-level queries.
Object-relational databases are an attempt to get the best of
both.
3
4. Evolution of ORDBMS
Object-oriented DBMS’s failed because they did not offer the
efficiencies of well-entrenched relational DBMS’s.
Object-relational extensions to relational DBMS’s capture
much of the advantages of Object Oriented, yet retain the
relation as the fundamental abstraction.
4
6. What is ORDBMS?
6
• Systems that attempts to extend relational database systems
with the functionality necessary to support a broader class of
applications and, in many ways, provide a bridge between the
relational and object-oriented paradigms
• This system supports objects, classes and inheritance in
database schemas and query language
9. Advantages of ORDBMSs
• Resolves many of known weaknesses of RDBMS
• Reuse and sharing
• Preserves significant body of knowledge and experience
gone into developing relational applications
9
10. Disadvantages of ORDBMS
• Complexity.
• Increased costs.
• Simplicity and purity of relational model are lost.
10
11. Object-Relational (OR) Operations
Common OR operations:
• Create - save (persist) a new object in the database
• Retrieve an object from the database
• Update data for an object already saved in database
• Delete object's data from the database
11
12. Object-Relational Mapping (ORM)
• A programming technique for converting data between
incompatible type systems using object-oriented programming
languages
• This creates, in effect, a "virtual object database" that can be used
from within the programming language
12
Object-intensive
app
Database
Other apps
ORM
• Appears as a normal database
to the database user
• Can share the database and
tables with other apps
13. Object-Relational Mapping Contd...
• Map between an object and a row in a database table.
13
• Database Table
– identifier is usually the primary
key of table
• Data Mapper
– a Data Access Layer
– performs bidirectional transfer of
data between a persistent data
store (often a relational database)
and an in-memory data
representation (the domain layer)
LOCATIONS
PK id INTEGER
name VARCHAR(80)
address VARCHAR(160)
Location
id: 101
name: Sherlock Holmes
address: 221 Baker Street
Data
Mapper
OOP (domain layer)
Relational database
14. Mapping an Object
14
LOCATIONS
id name address
101 Sherlock Holmes 221B Baker Street ...
102 Dr. Watson 224B Baker Street ...
Detective's : Location
id = 101
name = "Sherlock Holmes"
address = "221B Baker Street ..."
object diagram
save( )
15. Conclusion
• Aims to bridge the gap between conceptual data modeling
techniques for relational and object-oriented databases like the
entity-relationship diagram (ERD) and object-relational mapping
(ORM)
• Aims to connect the division between relational databases and the
object-oriented modeling techniques that are usually used in
programming languages like Java, C# and C++.
15