Object Oriented Data Base. Traditional Data Models : Hierarchical, Network (since mid- 60’s), Relational (since 1970 and commercially since 1982) Object.

Slides:



Advertisements
Similar presentations
Chapter 10: Designing Databases
Advertisements

Chapter 3 Data Modeling Copyright © 2014 McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent.
Object Databases Baochuan Lu. outline Concepts for Object Databases Object Database Standards, Languages, and Design Object-Relational and Extended-Relational.
Databases CIS 422. Lifetime of Data Transient results to the evaluations of expression Variables involved in procedure activation Global variables Dynamically.
Ch5: ER Diagrams - Part 1 Much of the material presented in these slides was developed by Dr. Ramon Lawrence at the University of Iowa.
ODMG Standard: Object Model1 OBJECT-ORIENTED DATABASE SYSTEMS ODMG Standard: Object Model Susan D. Urban and Suzanne W. Dietrich Department of Computer.
Chapter 2 Database System Design (part II)
Object-Oriented Databases
Database Design Chapter 2. Goal of all Information Systems  To add value –Reduce costs –Increase sales or revenue –Provide a competitive advantage.
Object Oriented Databases - Overview
July 13, 2015ADBS: OODB1 Concepts for Object-Oriented Databases Chapter 20.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
Modelling classes Drawing a Class Diagram. Class diagram First pick the classes –Choose relevant nouns, which have attributes and operations. Find the.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 11 Object and Object- Relational Databases.
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.
EER vs. UML Terminology EER Diagram Entity Type Entity Attribute
Chapter 14: Object-Oriented Data Modeling
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.
Object Oriented Data Base. Traditional Data Models : Hierarchical, Network (since mid- 60’s), Relational (since 1970 and commercially since 1982) Object.
Chapter 13 (Online): Object-Oriented Databases
DBMS Lecture 9  Object Database Management Group –12 Rules for an OODBMS –Components of the ODMG standard  OODBMS Object Model Schema  OO Data Model.
Limitations of the relational model. Just as the relational model supplanted the network and hierarchical model so too will the object – orientated model.
1 Announcements Research Paper due Friday November 19 For Wednesday read
Chapter 21 A Object Data Model - Intro Copyright © 2004 Pearson Education, Inc.
© 2006 ITT Educational Services Inc. SE350 System Analysis for Software Engineers: Unit 8 Slide 1 Chapter 9 Structuring System Data Requirements.
1 ER Modeling BUAD/American University Entity Relationship (ER) Modeling.
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.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Database Management System Prepared by Dr. Ahmed El-Ragal Reviewed & Presented By Mr. Mahmoud Rafeek Alfarra College Of Science & Technology Khan younis.
R McFadyen Chapter 7 Conceptual Data Modeling.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 - Domain Classes.
©Silberschatz, Korth and Sudarshan2.1Database System Concepts Chapter 2: Entity-Relationship Model Entity Sets Relationship Sets Design Issues Mapping.
Database Management COP4540, SCS, FIU Database Modeling A Introduction to object definition language (ODL)
1 Relational Databases and SQL. Learning Objectives Understand techniques to model complex accounting phenomena in an E-R diagram Develop E-R diagrams.
Chapter 21 C OQL Copyright © 2004 Pearson Education, Inc.
Chapter 21 Object Database Standards, Languages, and Design Copyright © 2004 Pearson Education, Inc.
7-1 © Prentice Hall, 2007 Chapter 7: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
Unit 3 Conceptual Data Modeling. Key Concepts Conceptual data modeling process Classes and objects Attributes Identifiers, candidate keys, and primary.
7-1 © Prentice Hall, 2007 Week 5: Conceptual Data Modeling Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich,
CHAPTER 13: OBJECT-ORIENTED DATA MODELING (OVERVIEW) © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition.
© 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.
SYSTEMSDESIGNANALYSIS 1 Chapter 22 Object-Oriented Design Jerry Post Copyright © 1997.
Databases Illuminated
ITEC 3220A Using and Designing Database Systems Instructor: Prof Z. Yang Course Website: 3220a.htm
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management
11-1 CHAPTER 11 Concepts for Object-Oriented Databases.
Entity-Relation Model. E-R Model The Entity-Relationship (ER) model was originally proposed by Peter in 1976 ER model is a conceptual data model that.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Chapter 7 Object-Oriented Database.
The ODMG Standard for Object Databases
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
Chapter 20 Concepts for Object-Oriented Databases Copyright © 2004 Pearson Education, Inc.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Chapter 12 Outline Overview of Object Database Concepts Object-Relational Features Object Database.
DATABASE MIS 327 Advanced Database 1. DATABASE 2 Objectives  Why are models important in designing systems?  How do you begin a database project? 
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 The Relational Model Chapter 3.
1 CS122A: Introduction to Data Management Lecture #4 (E-R  Relational Translation) Instructor: Chen Li.
Chapter 21 Object Database Standards, Languages, and Design Copyright © 2004 Pearson Education, Inc.
Business System Development
Object-Oriented Database Management System (ODBMS)
Chapter 12 Outline Overview of Object Database Concepts
Lec 3: Object-Oriented Data Modeling
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 Database Standards, Languages, and Design
Presentation transcript:

Object Oriented Data Base

Traditional Data Models : Hierarchical, Network (since mid- 60’s), Relational (since 1970 and commercially since 1982) Object Oriented (OO) Data Models since mid-90’s Reasons for creation of Object Oriented Databases Need for more complex applications Need for additional data modeling features Increased use of object-oriented programming languages Commercial OO Database products – several in the 1990’s, but did not make much impact on mainstream data management MAIN CLAIM: OO databases try to maintain a direct correspondence between real-world and database objects so that objects do not lose their integrity and identity and can easily be identified and operated upon Object: Two components: state (value) and behavior (operations).Introduction

3 OODBMS Vendors GemStone Systems, Inc. Hewlett-Packard, Inc. (OpenODB) IBEX Corporation, SA. Illustra (Informix, Inc.) Matisse Software, Inc. O2 Technology, Inc. Objectivity, Inc. Object Design, Inc. ONTOS, Inc. POET Software Corporation UniSQL Unisys Corporation (OSMOS) Versant Object Technology

ODMG (Object Data Management Group) Provides a standard model for object databases (Object Model)(Object Model) Supports object definition via ODLODL Supports object querying via OQLOQL Supports a binding with OOL (Three langusges : C++, Java, SMALTALK).a binding with OOL

The Object Model of ODMG Objects and Literals The basic building blocks of the object model are – Objects – Literlas An object has four characteristics 1.Identifier: unique system-wide identifier 2.Name: unique within a particular database and/or program; it is optional 3.Lifetime: persistent vs transient 4.Structure: specifies how object is constructed by the type constructor and whether it is an atomic object A literal has a current value but not an identifier Three types of literals 1.atomic: predefined; basic data type values (e.g., short, float, boolean, char ) 2.structured: values that are constructed by type constructors (e.g., date, struct variables) 3.collection: a collection (e.g., array) of values or objects

The Object Model of ODMG Interface and Class Definition ODMG supports two concepts for specifying object types Interface & Class Both have behaviors (operations) and state (attributes and relationships) Interface An interface is a specification of the abstract behavior of an object type State properties of an interface (i.e., its attributes and relationships) cannot be inherited from Objects cannot be instantiated from an interface Class A class is a specification of abstract behavior and state of an object type A class is Instantiable Supports “extends” inheritance to allow both state and behavior inheritance among classes Multiple inheritance via “extends” is not allowed

Object Definition Language (ODL) ODL supports semantics constructs of ODMG ODL is independent of any programming language ODL is used to create object specification (classes and interfaces) ODL is not used for database manipulation

ODMG Interface Definition: ODL Examples interface is ODMG’s keyword for class/type interface Date:Object { enum weekday{sun,mon,tue,wed,thu,fri,sat}; enum Month{jan,feb,mar,…,dec}; unsigned short year(); unsigned short month(); unsigned short day(); … boolean is_equal(in Date other_date); }; enumeration types (Enum),

A Very Simple Class ODL Examples A very simple, straightforward class definition class Degree { attribute string college; attribute string degree; attribute string year; };

A Class With Key and Extent ODL Examples class Person (extent persons key ssn) { attribute struct Pname {string fname …} name; attribute string ssn; attribute date birthdate; … short age(); }

Inheritance via “:” – An Example interface Shape { attribute struct point {…} reference_point; float perimeter (); … }; class Triangle: Shape (extent triangles) { attribute short side_1; attribute short side_2; … };

Object Query Language (OQL) OQL is DMG’s query language OQL works closely with programming languages such as C++ Embedded OQL statements return objects that are compatible with the type system of the host language OQL’s syntax is similar to SQL with additional features for objects

Simple OQL Queries Basic syntax: select…from…where… SELECT d.name FROM d in departments WHERE d.college = ‘Engineering’; An entry point to the database is needed for each query An extent name (e.g., departments in the above example) may serve as an entry point

An Example of OQL View A view to include students in a department who have a minor: define has_minor(dept_name) as select s from s in students where s.minor_in.dname=dept_name has_minor can now be used in queries

An Example of an OQL Aggregate Operator To compute the average GPA of all seniors majoring in Business: avg (select s.gpa from s in students where s.class = ‘senior’ and s.majors_in.dname =‘Business’);

Binding with OOL Example : C++ Language Binding C++ language binding specifies how ODL constructs are mapped to C++ statements and include: – a C++ class library – a Data Manipulation Language (ODL/OML) – a set of constructs called physical pragmas (to allow programmers some control over the physical storage concerns)

Class Library The class library added to C++ for the ODMG standards uses the prefix d_ for class declarations d_Ref is defined for each database class T To utilize ODMG’s collection types, various templates are defined, e.g., d_Object specifies the operations to be inherited by all objects

Template Classes A template class is provided for each type of ODMG collections: – d_Set – d_List – d_Bag – d_Varray – d_Dictionary Thus a programmer can declare: d_Set >

Data Types of Attributes The data types of ODMG database attributes are also available to the C++ programmers via the d _ prefix, e.g., d_Short, d_Long, d_Float Certain structured literals are also available, e.g., d_Date, d_Time, d_Intreval

Object Database Design For several years, entity-relationship diagrams were the predominant model­ing technique for database design. OOD Design used Unified Modeling Language (UML) method, instead of traditional entity-relationship (ER) The basic similarities between ER and class diagrams are – entities (classes) are drawn as boxes – binary relationships (associations) are drawn as connecting lines – n-ary associations (relationships) are drawn as diamonds. The main dif­ferences between UML and ER diagrams occur in the details. In UML the multiplicity of an association is shown as simple numerical notation instead of as a cryptic icon

21 Object Definition--encapsulation. – Object Name – Properties – Methods Customer CustomerID Address Phone AddCustomer DropCustomer Class name Properties Methods Commercial Contact VolumeDiscount ComputeDiscount Government Contact BalanceDue BillLateFees AddCustomer Inheritance Polymorphism Entity:Something in the real world that we wish to describe or track. Class: Description of an entity, that includes its attributes (properties) and behavior (methods). Object:One instance of a class with specific data. Property:A characteristic or descriptor of a class or entity. Method:A function that is performed by the class. Association:A relationship between two or more classes.

22 Class Diagram Class/Entity(box) Association/Relationship – Lines – Minimum 0: optional 1: required – Maximum Arrows 1, M Customer Order Item 1 … 1 0 … * 1 … *..

23 Sample Association Rules (Multiplicity) An order must have exactly 1 customer, – 1 … 1Minimum of 1 – 1 … 1Maximum of 1 And at least one item. – 1 … *Minimum of 1 – 1 … *Maximum many An item can show up on no orders or many orders. – 0 … *Optional (0) – 0 … *Maximum many Customer Sale Item 1 … 1 0 … * 1 … *

24 N-ary Association Example Employee Name... Component CompID Type Name Product ProductID Type Name * ** Assembly EmployeeID CompID ProductID Multiplicity is defined as the number of items that could appear if the other N-1 objects are fixed. Almost always “many.” 1 1 1

25 Association Details: Aggregation Sale SaleDate Employee Item Description Cost * * contains  Aggregation: the Sale consists of a set of Items being sold.

26 Association Details: Composition Bicycle Size Model Type … Wheels Rims Spokes … 12 built from  Composition: aggregation where the components become the new object. Crank ItemID Weight Stem ItemID Weight Size Bicycle Size Model Type … Wheels Crank Stem Two ways to display composition.

27 Association Details: Generalization Animal DateBorn Name Gender Color ListPrice Mammal LitterSize TailLength Claws Fish FreshWater ScaleCondition Spider Venomous Habitat {disjoint}

28 Inheritance Class Definition-- encapsulation – Class Name – Properties – Methods Inheritance Relationships – Generic classes – Focus on differences – Polymorphism – Most existing DBMS do not handle inheritance Accounts AccountID CustomerID DateOpened CurrentBalance OpenAccount CloseAccount Class name Properties Methods Savings Accounts InterestRate PayInterest Checking Accounts MinimumBalance Overdrafts BillOverdraftFees CloseAccount Inheritance Polymorphism

29 Multiple Parents Vehicle Human Powered MotorizedOn-RoadOff-Road CarBicycle or

30 Association Details: Reflexive Relationship Employee manager 0…1 worker *  manages A reflexive relationship is an association from one class back to itself. In this example, an employee can also be a manager of other employees.

31 Computed Attributes Denote computed values with a preceding slash (/). Employee Name DateOfBirth /Age Phone … {Age = Today - DateOfBirth}

32 Objects in a Relational Database CustomerID Address Phone Customer CustomerID Contact VolumeDiscount CommercialCustomer CustomerID Contact BalanceDue GovernmentCustomer Separate inherited classes. Link by primary key. Adding a new customer requires new rows in each table. Definitely need cascade delete.