Object Oriented & Object Relational Databases

Slides:



Advertisements
Similar presentations
Three-Step Database Design
Advertisements

OO databases 1 Object Oriented databases. OO databases 2 Developing OODBMS - motivation motivation more and more application areas require systems that.
Chapter 10: Designing Databases
Object Oriented Database Group 4 Mathieu Metz Palani Kumaresan Napa Gavinlertvatana Kristine Pei Keow Lee Prabhu Ramachandran.
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 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.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 4- 1.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 4- 1.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 4 Enhanced Entity-Relationship (EER) Modeling.
Geographic Information Systems
Chapter 20 Concepts for Object-Oriented Databases Copyright © 2004 Pearson Education, Inc.
1 Object Oriented & Object Relational Databases Ranga Raju Vatsavai Teaching Mentor (Prof. Shekhar) CSci 5708 : Architecture and Implementation of Database.
Object Oriented Databases - Overview
July 13, 2015ADBS: OODB1 Concepts for Object-Oriented Databases Chapter 20.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 11 Object and Object- Relational Databases.
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.
December 4, 2002 Data Modeling – James Cohen Enhanced Entity Relationship (EER) Model Presented by James Cohen.
EER vs. UML Terminology EER Diagram Entity Type Entity Attribute
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 4- 1 EER stands for Enhanced ER or Extended ER EER Model Concepts Includes all modeling concepts.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 8 The Enhanced Entity- Relationship (EER) Model.
Chapter 14: Object-Oriented Data Modeling
Object-Relational DBMSs By Yao-Wen Tu CS157b12/09/2003 Prof. Sin-Min Lee.
CS 405G Introduction to Database Systems
Object and object-relational databases 1. Object databases vs. Object-relational databases Object databases Stores complex objects – Data + functions.
1 Web-Enabled Decision Support Systems Entity-Relationship Modeling Prof. Name Position (123) University Name.
DBMS Lecture 9  Object Database Management Group –12 Rules for an OODBMS –Components of the ODMG standard  OODBMS Object Model Schema  OO Data Model.
Chapter 21 A Object Data Model - Intro Copyright © 2004 Pearson Education, Inc.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 7 Data Modeling Using the Entity- Relationship (ER) Model.
Chapter 20 Concepts for Object-Oriented Databases Copyright © 2004 Pearson Education, Inc.
Object-Oriented Database Management Systems (ODBMS)
1 Object Databases: Introduction. 2 Why OO? v Relational Systems are limited: –Structural restrictions on data –Missing semantics (value-based relationships)
1 CS 430 Database Theory Winter 2005 Lecture 17: Objects, XML, and DBMSs.
© Shamkant B. Navathe CC. © Shamkant B. Navathe CC Chapter 4 - Part I Enhanced Entity-Relationship and UML Modeling Copyright © 2004 Ramez Elmasri and.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 15: Object-Oriented Data Modeling Modern Database Management 9 h Edition Jeffrey A.
FEN NOEA/IT - Databases/ODB1 ODB – Object DataBases Object-Oriented – Fundamental Concepts UML and EE/R OO and Relational Databases Introduction.
Object-Oriented Data Modeling
Enhanced Entity-Relationship (EER) Modeling. Slide 4- 2 Chapter Outline EER stands for Enhanced ER or Extended ER EER Model Concepts Includes all modeling.
OODBMS: Introduction and Logical Database Design
Object Oriented Database By Ashish Kaul References from Professor Lee’s presentations and the Web.
11-1 CHAPTER 11 Concepts for Object-Oriented Databases.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide 4- 1.
The ODMG Standard for Object Databases
Slide 4-1 Elmasri and Navathe, Fundamentals of Database Systems, Fourth Edition Revised by IB & SAM, Fasilkom UI, 2005 Exercise 1. a property or description.
© Shamkant B. Navathe CC Enhanced Entity-Relationship Copyright © 2004 Ramez Elmasri and Shamkant Navathe.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe CHAPTER 4 Enhanced Entity-Relationship (EER) Modeling Slide 1- 1.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Chapter 12 Outline Overview of Object Database Concepts Object-Relational Features Object Database.
IST 210 Object Oriented Database. IST 210 Object-Oriented Concepts  Abstract Data Types  Class definition, provides extension to complex attribute types.
Faeez, Franz & Syamim.   Database – collection of persistent data  Database Management System (DBMS) – software system that supports creation, population,
Lecture 3 A short revision of ER and EER modelling See R. Elmasri, S.B. Navathe. Fundamentals of Database Systems (third edition) Addison-wesley. Chapter.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 4- 1.
OODBMS and ORDBMS. Background Object-oriented software, based on the principles of user-defined datatypes, along with inheritance and polymorphism, is.
Enhanced Entity-Relationship (EER) Model
The Enhanced Entity- Relationship (EER) Model
Enhanced Entity-Relationship and Object Modeling Objectives
Enhanced Entity-Relationship (EER) Modeling
Enhanced Entity-Relationship (EER) Modeling
Object-Oriented Database Management System (ODBMS)
Geographic Information Systems
Chapter 12 Outline Overview of Object Database Concepts
Conceptual data modeling
Lec 3: Object-Oriented Data Modeling
Database EER.
Enhanced Entity-Relationship (EER) Modeling
Presentation transcript:

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

Outline for today 11/24/03 Objectives Introduction OO Fundamentals Need for OO/OR-DBMS OO Fundamentals How (OO)DBMS incorporates OO ideas Database Modeling/Querying Conclusions OODBMS ORDBMS Conceptual ODL/UML EER/PEER

Outline for next class 11/26/03 Objectives ORDBMS Fundamentals How ORDBMS incorporates OO ideas Mapping Conceptual Model into Logical Model OQL vs. SQL-99 Comparison of OODBMS and ORDBMS Conclusions

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, …)

Introduction Why OODBMS? Let us start with modeling this simple example in a RDBMS Assume that we are given the following diagram 0,0 1 2 3 4 5 6 7 8

Introduction – Motivating Example Our objective is to store this graph in a RDBMS and support queries on these simple geometries What kind of relations we need? Print names of rectangles which are squares Find all objects which are inside the rectangle 7. 0,0 1 2 3 4 5 6 7 8

Introduction – Motivating Example Relations POINT(pname, x, y), EDGE(ename, aPoint), RECTANGLE(rname, anEdge). POINT RECTANGLE EDGE p1 3 4 p2 10 p3 p4 r5 e1 e2 e3 e4 e1 p1 p2 e2 p3 e3 p4 e4 0,0 1 2 3 4 5 6 7 8

Introduction – Motivating Example Logical Flow Edge e1 Edge e2 E1.ename = e2.ename E1.aPoint <> e2.aPoint Edge_Pnt_List (eName, stPnt, endPnt) Point p1 Point p2 Edge_length (eName, eLength) Rectangle r rname

Introduction – Motivating Example CREATE VIEW pnt_list (ename, stPnt, endPnt) AS SELECT e.ename, e1.aPoint, e2.aPoint FROM edge e1, edge e2 WHERE e1.ename = e2.ename AND e1.aPoint <> e2.aPoint; CREATE VIEW edge_length (ename, elength) AS SELECT e.ename, sqrt(sq(p1.x –p2.x) + sq(p1.y – p2.y) FROM pnt_list e, point p1, point p2 WHERE e.stPnt = p1.pname AND e.endPnt = p2.pname;

Introduction – Motivating Example Discussion Question – Print the square names

Introduction – Motivating Example Solution SELECT r.rname FROM rectangle r, edge_length e WHERE r.anEdge = e.ename GROUP BY r.rname HAVING max(e.elength) ~ MIN (e.elength);

Introduction Though we can model and query these simple geometric objects, its Not clean Complexity increases with complex objects (like irregular polygons) Even with these simple objects, how do you answer queries like ‘find nearest objects to point 2’ or ‘find all intersecting objects’ What is lacking Support for complex data types Support for predicates (e.g., area, intersect, length)

OODBMS-Fundamentals Has its origin in OO programming languages Object State – current value Behavior - what operations are permitted Difference between PL Object and DB Object PL – Objects exist only during program execution (transient objects). DB – Objects persist beyond program termination; stored permanently on a secondary storage DB – allows sharing of objects among multiple programs and applications

OODBMS-Fundamentals OID – unique system generated object identifier for each object Compare this with RDBMS primary key Object structure Arbitrarily complex in order to contain all necessary information about the object Compare this with RDBMS (rectangle object) – information about complex object is often scattered The state of complex object may be constructed from other objects using type constructors

OODBMS-Fundamentals Type constructors Basic – atom, tuple, and set Others – list, bag, and array (collection/bulk types) tuple – also called as a structured type Formally an object can be thought of as a triple (I,C,V) I – OID C – type constructor V – object state (current value)

OODBMS-Fundamentals Examples o1 = (i1, atom, ‘Pen-Chung Yew’) o2 = (i2, atom, ‘Minneapolis’) o3 = (i3, atom, ‘Computer Science’) o4 = (i4, set, {i1,i2,i3}) o5 = (i4, tuple, <DNAME:i3, DCHAIR:i1>)

OODBMS-Fundamentals Type hierarchies and Inheritance Example OODB permits definition of new types based on other predefined types, leading to a type hierarchy Example TYPE_NAME: function, function, …, function PERSON: firstName, lastName, dob, SSN STUDENT: firstName, lastName, dob, SSN, status, GPA FACULTY: firstName, lastName, dob, SSN, rank, salary STUDENT subtype_of PERSON: major, GPA FACULTY subtype_of PERSON: rank, salary

OODBMS-Fundamentals Exercise: Consider the geometry objects defined in our first example and defined class hierarchies 0,0 1 2 3 4 5 6 7 8

OODBMS-Fundamentals example - GEOMETRY_OBJECT: Shape, Area, ReferencePoint RECTANGLE subtype-of GEOMETRY_OBJECT (Shape=‘rectangle’): edge1, edge2, edge3, edge4

OODBMS-Fundamentals Standards: OOBMS ODMG Made up of several parts O2 Object Model Object Definition Language (ODL) Object Query Language (OQL) Binding to OO programming languages (C++, Smalltalk, Java) OOBMS O2 ObjectStore Jasmine

Database Modeling Enhance Entity Relationship (EER – Chap 4, Elmasri/Navathe) Pictogram Enhanced Entity Relationship (PEER – Chapter 2, SD A Tour). Unified Modeling Language (UML) Object Definition Language

Database Modeling Example Let us start with EER We use two examples (school-DB) and park-DB (from SDB-A Tour). Identify typical objects (and hierarchies) in school-DB Person, Student, Faculty, Department Identify relationships 1:1, 1:M, M:N, partial participation, … Let us start with EER Includes all the modeling concepts of ER Additionally includes oo concepts of – subclass, superclass, specialization and generalization, attribute and relationship inheritance

Database Modeling - EER Person SSN firstName d Student Faculty Department major worksin 1 N status rank dob lastName code name

Database Modeling - EER Find a suitable entity and define a overlapping type of relationship

Database Modeling - UML Person SSN dob firstName lastName Department Code Name Student status Faculty rank * {disjoint, mandatory} dept major 1 majorsIn worksIn 0..1 chair chairOf

Database Modeling - PEER Exactly one Many (0 or More) Optional (0 or One) One or More Numerically Specified Aggregation Inheritance Derived Class 1+ OGC-Geometry

Database Modeling - PEER State Park (ER Model) River Road Crosses Name Length Geometry NoOfLanes supplies Volume Facility Forest Forest_Stand Fire_Station Fire_Image Belongs_to within Elevation access Stand-id Specie Part_of captures manages Image-id Image 1 M N

Database Modeling - PEER Pictogram : miniature version of geographic object inserted inside of a box Entity pictograms Relationship pictograms Advantages Ease of use Complete grammar Translation rules Pictogram inserted ER diagram to SQL3 level constructs

Database Modeling - PEER Pictograms <Pictogram> <Shape> * // any possible shape ! // user-defined shapes <Shape> <Basic Shape> <Multi-Shape> <Derived Shape> <Alternate Shape>

Database Modeling - PEER <Basic Shape> Polygon Point Line Pictograms for Basic Shapes Pictograms for Multi-Shapes 0, n n <Cardinality> 0,1 1 1,n 0,n n

Database Modeling - PEER Pictograms for Derived Shapes Pictograms for Alternate Shapes <Derived Shape> <Basic Shape> <Basic Shape> <Basic Shape> <Basic Shape> <Derived Shape>

Database Modeling - PEER Any Possible Shape * ! Raster TIN Thesian Pictograms for Raster Shapes Pictograms for Relationships Part_of (Network) Part_of (Partition) User Defined Shape Raster Shape Raster TIN Thesian

Database Modeling - PEER State Park (PEER) River Road Crosses Name Length NoOfLanes supplies Volume Facility Forest Forest_Stand Fire_Station Fire_Image Belongs_to Elevation access Stand-id Specie Part_of captures manages Image-id 1 N M

Summary and Conclusions Learning Objectives Understand OO Concepts Conceptual Modeling 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

Next Week ORDMBS (SQL-3) in depth Mapping of Conceptual Model onto ORDBMS (SQL-3 DDL constructs) Examples using Postgresql/PostGIS Comparison of OODBMS and ORDBMS Conclusions

Additional Readings http://www.cs.umn.edu/~vatsavai/oo-ordbms.ppt 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. http://www-users.cs.umn.edu/~shekhar/5705/ Spatial Database – A Tour (Chapter 2 and 3)