Docsity

Object-Oriented Database Management Systems - Data Base Management System - Lecture Slides, Slides of Database Management Systems (DBMS)

Partial preview of the text

Download Object-Oriented Database Management Systems - Data Base Management System - Lecture Slides and more Slides Database Management Systems (DBMS) in PDF only on Docsity!

Object-Oriented Database

Management Systems (ODBMS)

ODBMS Outline

  • Definition
    • Why
    • Who
    • Approaches
  • Persistent Programming Languages
  • Object-Oriented Concepts
    • Object
    • Class & Encapsulation
    • Inheritance & Polymorphism
    • Object Identifier (OID)
  • Advantages and Disadvantages
  • Example Code
  • Conclusion

Why use ODBMS?

  • Complex data or relationship

requirements

  • Lack of unique, natural

identification

  • Large numbers of many to many

relationships

  • Access using traversals.

Graph/Tree structure.

  • Frequent use of type codes such

as those found in the relational

schema

Product DB

Who Uses ODBMS?

• Typical Applications for ODBMS:

– Computer-aided design (CAD)

– Computer-aided software engineering (CASE)

– Multimedia databases

  • Images, video, games, etc.

– Office automation systems (OIS)

– Expert database systems

Persistence Programming

Languages

  • A programming language that directly

manipulates persistent data in a database.

  • Persistent data exists after the program terminates.
  • Single program for application and data

management. No translation from database to

application programming needed.

  • Used with the object-oriented DB model

approach.

ODB

Application

Object-Oriented Concepts

Object

  • Object is an entity

containing:

  • Variables/Attributes – Object Data
  • Relationships – References to other objects
  • Methods – Object Functions
  • Messages – Accessing Methods

Variables

Methods

Employee SSN:int Name:String Hired:Date Salary:double … getSSN() getName() setName() …

Relationships

Object-Oriented Concepts

Inheritance & Polymorphism

  • Inheritance - A class (subclass) can inherit the

characteristic of another class (superclass).

  • Example: Employee has inherited attributes and

methods from Person.

  • Polymorphism - Each subclass object can respond

differently to same message by overriding the superclass method. Example:

Person

Employee Supplier Customer

Subclass

Superclass

Object-Oriented Concepts Object

Identifier

  • Object Identifier (OID) – The unique OID is

maintained by the DBMS.

  • ODBMS - Generated automatically by the system.

Example: Reference to Date object in the Employee object

for the date hired.

  • RDBMS – Primary key. Example: SSN for Employee

Employee Date

ODBMS Disadvantages

• Still developing

– Lack of accepted standards

– Lack of development tools.

– Change is more likely to occur in model

• More complicated than the relational model.

Takes longer to learn.

• Not as efficient when data and relations are

simple.

Java & ODB Example

  • Example of how to access data in

an ODB, using the ODMG Object Query Language (OQL):

  • Opens DB
  • Starts a transaction
  • Executes a query to find a Person object named “S. M. Lee”
  • Does additional processing on this Person object
  • Gets Address object of Person
  • Update street of Address object
  • Commit transaction
  • Close database

 import org.odmg.*;  import java.util.Collection;  Implementation impl = new com.vendor.odmg.Implementation();  Database db = impl.newDatabase();  Transaction txn = impl.newTransaction();  try {  db.open("addressDB", Database.OPEN_READ_WRITE);  txn.begin();  // perform query  OQLQuery query = new OQLQuery(  "select x from Person x where x.name = \“S. M. Lee"");  Collection result = (Collection) query.execute();  Iterator iter = result.iterator();  // iterate over the results  while ( iter.hasNext() ) {  Person person = (Person) iter.next();   // do some addition processing on the person (now shown)  // now traverse to the address object and update its value  person.address.street = "13504 4th Avenue South";  }  txn.commit();  db.close();  }  //exception handling would go here ... Source: http://www.service-architecture.com/object-oriented-databasesDocsity.com