Additional ODL Concepts OO Model to Relational Model Object-Relational Design OO vs OR.

Slides:



Advertisements
Similar presentations
Chapter 10: Designing Databases
Advertisements

1 CHAPTER 4 RELATIONAL ALGEBRA AND CALCULUS. 2 Introduction - We discuss here two mathematical formalisms which can be used as the basis for stating and.
CSC 570 Notes for Chapter 10 Advanced Topics in Relational Databases.
Object Databases Baochuan Lu. outline Concepts for Object Databases Object Database Standards, Languages, and Design Object-Relational and Extended-Relational.
603 Database Systems Senior Lecturer: Laurie Webster II, M.S.S.E.,M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 6 A First Course in Database Systems.
Functional Dependencies - Example
ODMG Standard: Object Model1 OBJECT-ORIENTED DATABASE SYSTEMS ODMG Standard: Object Model Susan D. Urban and Suzanne W. Dietrich Department of Computer.
CMPT 354, Simon Fraser University, Fall 2008, Martin Ester 227 Database Systems I Design Theory for Relational Databases.
Design Principles: Faithfulness
Design Principles: Faithfulness
Java Programming, 3e Concepts and Techniques Chapter 5 Arrays, Loops, and Layout Managers Using External Classes.
Movies length titleyearfilmType Voices isa Cartoons isa MurderMystery weapon toStar Our Movie Example.
Chapter 15 (Web): Object-Oriented Database Development
From E/R Diagrams to Relations. The Relational Data Model Database Model (E/R) Relational Schema Physical storage Diagrams (E/R) Tables: row names: attributes.
Programs with SQL Host language + Embedded SQL Preprocessor Host Language + function calls Host language compiler Host language program Preprocessor Host.
1 Pertemuan 6 The structure part of object data model (Lanjutan) Matakuliah: M0174/OBJECT ORIENTED DATABASE Tahun: 2005 Versi: 1/0.
Other Data Models. Text New edition (DBS the complete book): Chapter 4 Old edition (First course in DBS): –Section 2.1 –Section –Section 2.4.1,
Object Oriented Databases - Overview
1 The Entity-Relationship Data Model Chapter 2 (Database Design)
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.
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.
Database Design April 3, Projects, More Details Goal: build a DB application. (almost) anything goes. Groups of 3-4. End of week 2: groups formed.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented Design.
REFACTORING Lecture 4. Definition Refactoring is a process of changing the internal structure of the program, not affecting its external behavior and.
DBMS Lecture 9  Object Database Management Group –12 Rules for an OODBMS –Components of the ODMG standard  OODBMS Object Model Schema  OO Data Model.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
Why Object-Oriented DBMS? Abstract data types (relational data model is too simple). Interface with host programming language Managing large number of.
Chapter 21 A Object Data Model - Intro Copyright © 2004 Pearson Education, Inc.
Chapter 21 B Mapping to ODL Copyright © 2004 Pearson Education, Inc.
1 Advanced Databases (CM036): Lecture # 5 ( Object-Relational and Nested-Relational Databases) Introduction to Object-Relational features of Oracle 9i.
Database Management COP4540, SCS, FIU Relational Model Chapter 7.
1 Object Databases: Introduction. 2 Why OO? v Relational Systems are limited: –Structural restrictions on data –Missing semantics (value-based relationships)
Database Systems Other Data Models assoc. prof., dr. Vladimir Dimitrov web: is.fmi.uni-sofia.bg.
©Silberschatz, Korth and Sudarshan9.1Database System Concepts Chapter 9: Object-Oriented Databases Nested Relations Complex Types and Object Orientation.
Conversion E/R to Relational CIS 4301 Lecture Notes Lecture 6 - 1/31/2006.
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.
Object Definition Language
An OO schema language for XML SOX W3C Note 30 July 1999.
Unified Modeling Language © 2002 by Dietrich and Urban1 ADVANCED DATABASE CONCEPTS Unified Modeling Language Susan D. Urban and Suzanne W. Dietrich Department.
Built-in Data Structures in Python An Introduction.
Object-Relational Modeling. What Is a Relational Data Model? Based on the concept of relations (tables of data) Relationships established by matching.
© D. Wong Ch. 2 Entity-Relationship Data Model (continue)  Data models  Entity-Relationship diagrams  Design Principles  Modeling of constraints.
OODBMS: Introduction and Logical Database Design
Object Relational Features
11-1 CHAPTER 11 Concepts for Object-Oriented Databases.
CS 157B Database Systems Dr. T Y Lin. Updates 1.Red color denotes updated data (ppt) 2.Class participation will be part of “extra” credits to to “quiz.
© D. Wong Security and User Authorization in SQL 8.7 pp. 410  Authorization ID = user name  Special authorization ID: PUBLIC  Privileges for:
Object-Relational Model. Review: Data Models Hierarchical Network ER (Pure) Relational (Pure) Object-oriented (ODMG) Object-relational (since SQL:1999)
CPSC 603 Database Systems Lecturer: Laurie Webster II, M.S.S.E., M.S.E.E., M.S.BME, Ph.D., P.E. Lecture 4 Introduction to a First Course in Database Systems.
The Entity-Relationship Model CIS 4301 Lecture Notes 1/12/2006.
The ODMG Standard for Object Databases
Lecture 2: Review of Object Orientation. © Lethbridge/La ganière 2005 Chapter 2: Review of Object Orientation What is Object Orientation? Procedural.
Chapter 20 Concepts for Object-Oriented Databases Copyright © 2004 Pearson Education, Inc.
CS 157B Database Systems Dr. T Y Lin. 1.2 Overview of a Database Management System Data-Definition Language Commands –Illustrated by three examples.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Chapter 12 Outline Overview of Object Database Concepts Object-Relational Features Object Database.
1 10 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 10 Designing Databases.
© D. Wong Ch. 3 (part 1)  Relational Model basics  From E/R diagram to Relations.
High-level Database Models Prof. Yin-Fu Huang CSIE, NYUST Chapter 4.
1 Database Modeling (Semantic data modeling) ER Data Model –A high-level conceptual data model –Proposed by P. Chen (1976) –Widely used in DB design process.
The Entity-Relationship Diagram for Data Modeling
Chapter 12 Outline Overview of Object Database Concepts
Transforming E/R to Relational Model.
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.
Chapter 15: Object-Oriented Database Development
Chapter 3: Multivalued Dependencies
Presentation transcript:

Additional ODL Concepts OO Model to Relational Model Object-Relational Design OO vs OR

Text New edition/complete book: Section Old edition: –2.4.1, –2.5.2, –3.2 (all subsections) –3.4.1

Topics More on type: –Bag, set, and list –Array, dictionary, and structures Multiway relationship Subclasses and inheritance Keys Extent

Bag, set, and list Set: a set of objects of the same type, no repetition allowed, declared by Set where T is a type. Bag: set of objects of the same type, repetition allowed, declared by Bag where T is a type. List: set of ordered objects of the same type, repetition allowed, declared by List where T is a type.

Array, dictionary, and structures Array: a list whose length is predefined, declared by Array - a list of i elements of type T Dictionary: declared by Dictionary, whose value is a set of pair, each pair consists of a value of type T (key) and a value of type S (range) Structure: Struct N {T 1 F 1,…,T n F n } (T i are types and F i are names)

Rules on types of relationships and attributes Type of a relationship is either a class type or a collection type constructor applied to a class type. Type of an attribute – can be an arbitrary, possible type.

Multiway relationship class Contract { relationship Movie theMovie inverse Movie::contractsFor; relationship Star theStar inverse Star::contractsFor; … } In Movie: relationship Set contractsFor inverse Contract::theMovie; Movies Contracts Studios Stars Movies Studios Stars Contracts Movie_of Star_of Producing studio Studio of star Convert to binary relationship and follow the rule !

Subclasses declared with ‘extends’ class Cartoon extends Movie { relationship Set voices; } class MurderMystery extends Movie { attribute string weapon; }

Inheritance Multiple inheritance: list of classes, separated by ‘:’ after extends class CartoonMurderMystery extends MurderMystery : Cartoon Conflict might arise – different solutions: –disallowed –specifying clearly from which property are inherited from which class –adding new attributes/relationships to avoid conflicts

Extent The set of objects of a class that exists at a given time - difference from the class declaration (similar to instance vs schema) Can have different name – declared explicitly with the keyword extent Example: class Movie (extent Movies) (the name of the extent is Movies)

Keys Optional Declared by key word key/keys Allow relationships to be part of key Example: class Movie (extent Movies key (title,year) (another key here) )

Interface Class definition with no associated extent Declaration with keyword interface Enable the existence of several (extent of) classes with the same properties interface C { …} ; class C1 extends C (extent C11) { extra properties }; class C2 extends C (extent C21) { extra properties }; Two extents of C (C11 and C21) can exist two together.

From ODL to Relational Design Problems: –no key –non-atomic values for attributes –methods in object definition Attributes to attributes –atomic: straightforward –non-atomic: structure set-value (or collection typed value) Relationships Methods

OLD Attributes to Relational Attributes Atomic: one-to-one correspondence Non-atomic: case-by-case –Structure: one attribute for atomic component of the structure, renaming if necessary –Set: approach to deal with structure can be used –Bag: add a new attribute count to distinguish object –List: add a new attribute position to record the order of the object –Array: introduce attributes for each array –Dictionary: similar to set value

Problem Obtained relational schemas might not be in BCNF (others as well) To get optimal solution: conversion then normalization

ODL Relationships to Relation Similar to conversion of E/R relationships to relations: key of two objects OLD Relationships come in pairs: one only Combining techniques can be used – applicability depends on the multicity of the relationship. Example: class Movie (extent Movies key (title,year)){ … relationship Set stars inverse Star::starredIn; … } we need only one relation starredIn(title, year, starName) even though ‘starredIn’ will appear as a relationship in the declaration of the class Star.

Object-Relational Model Relational model with object-oriented features: –structured types for attributes (removing ‘atomic’ requirement) –methods (applied on user-defined types) –identifiers for tuples (similar to OID) –references

Nested Relations Attributes need not be atomic: Stars(name, address(street,city), birthdate, movies(title, year)) nameaddressbirthdatemovie Fisher9/9/99 Hamill8/8/88 streetcity MappleH’wood LocustMalibu titleyear Star War1977 Empire1980 streetcity OakB’wood titleyear Star War1977 Return1983

References Specify by {*R} where R is the referred relation Stars(name, address(street,city), birthdate, movies({*Movies})) This implies that the attribute movie of the Stars relation is a set of references to tuples in the Movies relation

The Stars example with Reference nameaddressbirthdatemovie Fisher9/9/99 Hamill8/8/88 streetcity MappleH’wood LocustMalibu titleyear Star War1977 Return1983 Empire1980 streetcity OakB’wood

Object-oriented vs Object-relational Similar features: –Objects in OO model could be represented as tuples in OR model (due to the introduction of set and references) –Extents and relations: use interface to overcome the restriction of ‘one extent with one class’ –Methods: implemented in OR DBMS –Type systems: almost the same –References and OID: references are not necessary hidden from users, OID does –Backward compatibility: OR does but not OO – possible reason for popularity of OR vs OO Conversion from OO to OR: –simpler than OO to Relational Model –mostly straightforward (one-to-one correspondence) – otherwise, use the techniques of OO to Relational