1 Object Oriented & Object Relational Databases Ranga Raju Vatsavai Teaching Mentor (Prof. Shekhar) CSci 5708 : Architecture and Implementation of Database.

Slides:



Advertisements
Similar presentations
Why Object-Oriented DBMS? Abstract data types Interface with host programming language (the impedance mismatch). Object identity: (peter, 40, {(john, 15,
Advertisements

Jane Reid, BSc/IT DB, QMUL, 25/2/02 1 Object-oriented DBMS Background to ODBMS ODBMS requirements Object components ODB conceptual design –Graphical ODB.
Object Oriented & Object Relational Databases
Database Systems: Design, Implementation, and Management Tenth Edition
Object Databases Baochuan Lu. outline Concepts for Object Databases Object Database Standards, Languages, and Design Object-Relational and Extended-Relational.
--The Object Database--1 The Object Database  Object databases integrate database technology with the object-oriented paradigm  In object databases,
ODMG Standard: Object Model1 OBJECT-ORIENTED DATABASE SYSTEMS ODMG Standard: Object Model Susan D. Urban and Suzanne W. Dietrich Department of Computer.
Chapter Object-Oriented Practices. Agenda Object-Oriented Concepts Terminology Object-Oriented Modeling Tips Object-Oriented Data Models and DBMSs.
©Silberschatz, Korth and Sudarshan8.1Database System Concepts Chapter 8: Object-Oriented Databases Need for Complex Data Types The Object-Oriented Data.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Geographic Information Systems
Object-Oriented Databases
Object Oriented Databases - Overview
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 11 Object and Object- Relational Databases.
Object-Oriented Methods: Database Technology An introduction.
1 Announcements Research Paper due Monday November 22.
Databases Illuminated Chapter 7 The Object-Oriented Model.
RIZWAN REHMAN, CCS, DU. Advantages of ORDBMSs  The main advantages of extending the relational data model come from reuse and sharing.  Reuse comes.
Advanced Database CS-426 Week 13 – Object Relational Databases.
EER vs. UML Terminology EER Diagram Entity Type Entity Attribute
Object-Relational DBMSs By Yao-Wen Tu CS157b12/09/2003 Prof. Sin-Min Lee.
Object and object-relational databases 1. Object databases vs. Object-relational databases Object databases Stores complex objects – Data + functions.
Advanced Database CS-426 Week 2 – Logic Query Languages, Object Model.
CSE314 Database Systems Data Modeling Using the Entity- Relationship (ER) Model Doç. Dr. Mehmet Göktürk src: Elmasri & Navanthe 6E Pearson Ed Slide Set.
Object Oriented Software Development
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
COMPUTING FOR BUSINESS AND ECONOMICS-III. Lecture no.6 COURSE INSTRUCTOR- Ms. Tehseen SEMESTER- Summer 2010.
Chapter 24 Introduction to Object DBMSs Prepared by Kai Huang CS157B Prof Sin-Min Lee.
CSC2012 Database Technology & CSC2513 Database Systems.
DBMS Lecture 9  Object Database Management Group –12 Rules for an OODBMS –Components of the ODMG standard  OODBMS Object Model Schema  OO Data Model.
1 Announcements Research Paper due Friday November 19 For Wednesday read
Why Object-Oriented DBMS? Abstract data types (relational data model is too simple). Interface with host programming language Managing large number of.
Chapter 21 B Mapping to ODL Copyright © 2004 Pearson Education, Inc.
1 Object Databases: Introduction. 2 Why OO? v Relational Systems are limited: –Structural restrictions on data –Missing semantics (value-based relationships)
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
1 CS 430 Database Theory Winter 2005 Lecture 17: Objects, XML, and DBMSs.
ADVANCED DATABASE SYSTEMS DR. FATEMEH AHMADI- ABKENARI SEPTEMBER Object Databases.
Object Persistence Design Chapter 13. Key Definitions Object persistence involves the selection of a storage format and optimization for performance.
Chapter 18 Object Database Management Systems. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for object.
 Three-Schema Architecture Three-Schema Architecture  Internal Level Internal Level  Conceptual Level Conceptual Level  External Level External Level.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 18 Object- Oriented Database Processing.
Unified Modeling Language © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Unified Modeling Language Susan D. Urban and Suzanne W. Dietrich Department.
Object relational database managmement systems (ORDBMS) Adapted by Edel Sherratt from originals by Nigel Hardy.
FEN NOEA/IT - Databases/ODB1 ODB – Object DataBases Object-Oriented – Fundamental Concepts UML and EE/R OO and Relational Databases Introduction.
ITEC 3220A Using and Designing Database Systems Instructor: Prof Z. Yang Course Website: 3220a.htm
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
ITEC 3220A Using and Designing Database Systems Instructor: Gordon Turpin Course Website: Office: CSEB3020.
OODBMS: Introduction and Logical Database Design
Object Oriented Database By Ashish Kaul References from Professor Lee’s presentations and the Web.
Chapter 2 Object-Relational DBMSs Chapter 28 in Textbook.
Object Relational Features
11-1 CHAPTER 11 Concepts for Object-Oriented Databases.
© D. Wong Security and User Authorization in SQL 8.7 pp. 410  Authorization ID = user name  Special authorization ID: PUBLIC  Privileges for:
The ODMG Standard for Object Databases
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Chapter 12 Outline Overview of Object Database Concepts Object-Relational Features Object Database.
OODBMS and ORDBMS. Background Object-oriented software, based on the principles of user-defined datatypes, along with inheritance and polymorphism, is.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
Data Resource Management Lecture 8. Traditional File Processing Data are organized, stored, and processed in independent files of data records In traditional.
ISC321 Database Systems I Chapter 2: Overview of Database Languages and Architectures Fall 2015 Dr. Abdullah Almutairi.
Why Object-Oriented DBMS?
Entity- Relationship (ER) Model
DATA REQIREMENT ANALYSIS
Object-Relational DBMSs
Chapter 12 Outline Overview of Object Database Concepts
Chapter 10 Thinking in Objects
ISC321 Database Systems I Chapter 10: Object and Object-Relational Databases: Concepts, Models, Languages, and Standards Spring 2015 Dr. Abdullah Almutairi.
ITEC 3220A Using and Designing Database Systems
Object-Oriented Databases
Presentation transcript:

1 Object Oriented & Object Relational Databases Ranga Raju Vatsavai Teaching Mentor (Prof. Shekhar) CSci 5708 : Architecture and Implementation of Database Management Systems, Fall 2003 Week 15 (11/24, 11/26/03) Lecture Notes

2 Last Class (11/24/03) RDBMS limitations No support for complex data types and predicates OO Rich set of features – encapsulation, inheritance,.. Helps manage complexity Conceptual Modeling – Simple Extensions EER, UML, PEER

3 Learning Objectives Basic concepts of OO and OR models Extensions at conceptual modeling Mapping Conceptual Model into Logical Model Exposure to additional features in SQL:1999 standard. Ability to model and implement a broader class of applications (spatial, multimedia, engineering, biological, scientific, …)

4 Mapping Conceptual Model onto Logical Model EER ModelOO/ODL Entity or Subclass Class (all attributes, multivalued attributes – set, bag or list, composite - tuple Binary relationships Add relationship properties or reference attributes Include appropriate operations for each class N-ary relationshps Separate classes with appropriate references to each participating class SubclassClass inherits the type and methods of its super class, and all attributes, relationship references, and operations

5 Mapping Conceptual Model onto Logical Model OO – Object Definition Language OR – SQL3 DDL ODL is an extension of Interface Description Language. ODL class definition includes Attributes Relationships Methods

6 Mapping - ODL Example interface Student { attribute string status; attribute Department major; relationship set majorOf inverse Department::students; …. }

7 ORDBMS Fundamentals Try to unify aspects of both relational and object databases Relation is still central No standard of what constitutes an ORDBMS Won Kim’s (UniSQL) white paper Michael Stonebraker – ORDBMS, The Next Great Wave Query language – SQL3

8 ORDBMS Fundamentals (SQL3) OO Features in SQL3 Objects Type constructors Collection types User-defined functions and procedures Support for large objects Inheritance

9 ORDBMS Fundamentals (SQL3) Objects in SQL3 comes in two flavors ADTs and Row objects ADTs – user defined arbitrary data types is a key feature of ORDBMS ADTs are a combination of atomic data types and associated methods DBMS doesn’t need to know about how ADT’s are stored or their methods work? It just has to know about ADT’s signature Hiding ADT internals is called encapsulation

10 ORDBMS Fundamentals (SQL3) Here is a general form of ADT specification CREATE TYPE ( list of component attributes with individual types Optional declaration of = and < functions for the type declaration of other functions (methods) for the type ); Example CREATE TYPE DepartmentADT ( Code int, Name char(10), EQUALS deptEQ,//deptEQ – we will define it later LESS THAN NONE//DEFAULT Defintion of other functions goes here … );

11 ORDBMS Fundamentals (SQL3) Defining ADT’s methods FUNCTION ( ) RETURNS ; Functions are of two types – internal and external External functions are written in host language and only signature appears in ADT definition. Internal functions are written in extended SQL := assignment local variables can be declared inside function (:a DepartmentADT) dot op is used to access components of structure BEGIN and END are used to collect several stmts.

12 ORDBMS Fundamentals (SQL3) Here is an example constructor method FUNCTION DepartmentADT(:id INT, :dname CHAR(10)) RETURNS DepartmentADT; :d DepartmentADT; BEGIN :d := DepartmentADT(); :d.code := :id; :d.name := :dname; RETURN :d; END ; Discussion question – define method deptEQ

13 ORDBMS Fundamentals (SQL3) Function deptEQ(:d1 DepartmentADT, :d2 DepartmentADT) RETURNS BOOLEAN; RETURN (:d1.code = :d2.code AND :d1.name = :d1.name); We could have used DEFAULT (system defined)

14 ORDBMS Fundamentals (SQL3) External functions ADT’s can have methods that are written in host language (e.g. C, C++, …) Only signature appears in ADT definition DECLARE EXTERNAL LANGUAGE Example DECLARE EXTERNAL Square POLYGON RETURNS BOOLEAN LANGUAGE C;

15 ORDBMS Fundamentals (SQL3) Row type objects Essentially tuples and they roughly resembles struct/class CREATE ROW TYPE ( ) CREATE ROW TYPE DepartmentType( code INT, name CHAR(10) );

16 ORDBMS Fundamentals (SQL3) Creating Relations of Row Type OF TYPE Example CREATE TABLE Department OF TYPE DepartmentType; References – A component attribute of tuple may be a reference to a tuple of another (or posibly same) relation. CREATE ROW TYPE Department ( code INT, name CHAR(10), chair REF (Faculty_Row_Type) );

17 ORDBMS Fundamentals (SQL3) CREATE ROW TYPE Department_Row_Type ( code INT, name CHAR(10), chair REF (Faculty_Row_Type) ); CREATE TABLE Department OF TYPE Department_Row_Type; Q? Print chair name of EECS department SELECT d.chair->name FROM Department d WHERE d..name = ‘EECS’;

18 ORDBMS Fundamentals (SQL3) Collection types setof Example CREATE TABLE Rectangles (rname CHAR(10), pnts setof(Points)). SELECT r.rname FROM Rectangles r WHERE count(r.pnts) = 5; rnamepoints r1{{1,1},{1,2},{2,2},{2,1},{1,1}}

19 ORDBMS Fundamentals (SQL3) Support for large objects blob, clob Consider class recording Class_video_recordings(cid: integer, cmdate: date, loc char(10), video: BLOB)

20 ORDBMS Fundamentals (SQL3) Inheritance Used in two ways: reusing and refining types, and for creating hierarchies of collections of similar but not identical objects UNDER CREATE TYPE Student UNDER Person (addr address) Creates an explicit relationship between subtype Student and supertype Person. An object of subtype is considered to be an object of supertype.

21 ORDBMS Fundamentals (SQL3) OO Features in SQL3 Objects Type constructors Collection types User-defined functions and procedures Support for large objects Inheritance

22 Outline for today’s class 11/26/03 Objectives Mapping Conceptual Model into Logical Model ORDBMS Fundamentals How ORDBMS incorporates OO ideas SQL3 Physical Design and efficiency Issues Demo Conclusions

23 Physical design and efficiency issues Need efficiently storage of ADT’s and structured objects efficient indexed access Main problem is size, so disk layout is important BLOBS require special storage, typically different location on disk (separate from the tuple) Indexing Domain specific (large collection of indices) Extendible indices

24 Physical design and efficiency issues Query processing User defined aggregate functions (SQL defined may not be useful) ORDBMS allows registering new aggregate functions Security – external methods of ADT’s – can compromise the database or crash (if its buggy). One solution – interpreted rather than compiled (Java and procedural portions of SQL:1999). Run in different address space than the DBMS Method Caching Cache of input and output of methods Pointer Swizzling Technique to reduce cost of cached object

25 Comparison of OO and ORDBMS Fundamental difference is in philosophy OODMSs try to add DBMS functionality to Prog. Lang. ORDBMS try to add richer data types and predicates to an RDBMS OODBMS – aimed at applications where object-centric viewpoint is appropriate ORDBMS – aimed at applications where large data collections are the focus Query (OQL) is not efficiently supported in OODBMS Query processing is the centerpiece of an ORDBMS

26 Outline for today’s class 11/26/03 Objectives Mapping Conceptual Model into Logical Model ORDBMS Fundamentals How ORDBMS incorporates OO ideas SQL3 Physical design and efficiency issues Demo Summary and Conclusions

27 Demo Postgresql/PostGIS

28 Summary and Conclusions Basic concepts of OO and OR models Extensions at conceptual modeling Mapping Conceptual Model into Logical Model Exposure to additional features in SQL:1999 standard. Ability to model and implement a broader class of applications (spatial, multimedia, engineering, biological, scientific, …) ORDBMS/SQL3 offer much promise

29 Additional Readings Main – Database Management Systems by Raghu Ramakrishnan (Chapter 24: Object Database Systems). Additional References (relevant chapters): Fundamentals of Database Systems – Elmasri & Navathe A First Course In Database Systems – Ullman & Widom. Spatial Database – A Tour (Chapter 2 and 3)

30 Acknowledgements PFF Faculty Prof. Shekhar Class Happy Thanks Giving and good luck on final exams.