Chapter 12 - 1 Implementation Faithful translation of a design into a target environment Design should be free of target-environment dependencies Should.

Slides:



Advertisements
Similar presentations
Chapter 10: Designing Databases
Advertisements

Why Object-Oriented DBMS? Abstract data types Interface with host programming language (the impedance mismatch). Object identity: (peter, 40, {(john, 15,
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.
--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.
NestedRelations: 1 Nested Relations Flat schemas often have replicated data values in their relations. Nested schemas allow us to collapse some of these.
Chapter Design Objectives Obtain the theoretically “best” design (normalize) –Remove redundancy and update anomalies –Remove nulls –Minimize the.
XNF: 1 XML and NNF A Standard Form for XML Documents (XNF) Properties –As few hierarchical trees as possible –No redundant data values in any tree Method.
Chapter Abstraction Concrete: directly executable/storable Abstract: not directly executable/storable –automatic translation (as good as executable/storable)
Chapter 15 (Web): Object-Oriented Database Development
Chapter Nested Schemes Flat schemes often have replicated data values. Nested schemes allow us to collapse some of these replicated data values.
Object-Oriented Standards OMG OMDG. Overview Object Management Group (OMG) International non profit-making consortium founded in 1989 to address object.
1 Pertemuan 17 Building Object Database Application Matakuliah: M0174/OBJECT ORIENTED DATABASE Tahun: 2005 Versi: 1/0.
Chapter Specification Detailed and precise proposal for a system Provides the technical basis for a contract Typically increases understanding and.
XNF-1 XML and NNF A Standard Form for XML Documents (XNF) Properties –As few hierarchical trees as possible –No redundant data values in any tree Method.
Programs with SQL Host language + Embedded SQL Preprocessor Host Language + function calls Host language compiler Host language program Preprocessor Host.
Create, Insert, Delete, Update. Create Create database Create table Create index – Primary – Secondary.
CostAnalysis: 1 Cost Analysis Rule-of-Thumb Guidelines As a guide, consider denormalizing if: –redundancy is minimal and update anomalies are not expected.
QueryRewriting: 1 Query Rewriting (for Query “Optimization”) Main Strategy: Make intermediate results small by applying selection and projection early.
Fundamentals, Design, and Implementation, 9/e Chapter 16 Object-Oriented Database Processing.
Object Oriented Databases - Overview
Design Algorithm Essentials 1.Combine functional edges with the same tail object set(s) into a scheme. (The tail object set(s) and any others in a 1-1.
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.
EER vs. UML Terminology EER Diagram Entity Type Entity Attribute
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 Query Language (OQL) and Language Binding
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.
Chapter 2: Object Model Prof. Hyoung-Joo Kim OOPSLA Lab. Dept. of Computer Engineering Seoul National Univ.
Algorithm Programming Bar-Ilan University תשס"ח by Moshe Fresko.
Object oriented databases
Database Management COP4540, SCS, FIU Database Modeling A Introduction to object definition language (ODL)
Chapter 18 Object Database Management Systems. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for object.
Object-Oriented Database Processing
Chapter 21 Object Database Standards, Languages, and Design Copyright © 2004 Pearson Education, Inc.
© 2002 by Prentice Hall 1 David M. Kroenke Database Processing Eighth Edition Chapter 18 Object- Oriented Database Processing.
Chapter 3 Object Specification Languages Prof. Hyoung-Joo Kim OOPSLA Lab. Dept. of Computer Engineering Seoul National Univ.
1 Advanced Databases (CM036) – Lecture # 12: The ODMG Standard for Object Databases Object Query Language (OQL) & Language Binding Advanced Database Technologies.
Object Definition Language
Scaling Heterogeneous Databases and Design of DISCO Anthony Tomasic Louiqa Raschid Patrick Valduriez Presented by: Nazia Khatir Texas A&M University.
Databases Illuminated
CSE 6331 © Leonidas Fegaras OODB1 Object-Oriented Databases and the ODMG Standard.
Database Design Why do we need it? – Agree on structure of the database before deciding on a particular implementation. Consider issues such as: –What.
Persistent State Service 1  Concept  Persistence is the ability of an object state to survive termination of the process in which the object executes.
© D. Wong Security and User Authorization in SQL 8.7 pp. 410  Authorization ID = user name  Special authorization ID: PUBLIC  Privileges for:
My Research: Adding More Support for Relationships to DBMSs by Dr. Bryon K. Ehlmann Computer Science Department Southern Illinois University Edwardsville.
AND OBJECT-ORIENTED DATABASES OBJECT-RELATIONAL DATABASES.
RelAlg: 1 Relational Algebra An Algebra is a pair: (set of values, set of operations) Note that an algebra is the same idea as an ADT Relational Algebra:
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.
E.Bertino, L.Matino Object-Oriented Database Systems 1 Chapter 9. Systems Seoul National University Department of Computer Engineering OOPSLA Lab.
OOPSLA Lab.1 Chapter 6 Smalltalk Binding Prof. Hyoung-Joo Kim OOPSLA Lab. Dept. of Computer Engineering Seoul National University.
Extended ER Mappings & Models. General Principle #1 Graphical representations dictate cardinality relationships among attributes. When graphical representations.
SQL: 1 SQL Correspondence with Relational Algebra select A from r where B = 1 Assume r(AB) and s(BC). select B from r except select B from s select A as.
1 Advanced Databases – Lecture # 12: The ODMG Standard for Object Databases Advanced Databases The ODMG Standard for Object Databases.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe Chapter 12 Outline Overview of Object Database Concepts Object-Relational Features Object Database.
1 ODMG. 2 Object Database Management Group (ODMG) ODMG has been formed in late 1991 by: ObjectDesign, Ontos, O2 Technology, Versant, Objectivity, Digital.
1 ODMG: ODL and OQL This lecture is a short version of: Lecture 11 (on ODL) & Lecture 12 (on OQL) M. Akhtar Ali School of Informatics.
OOPSLA Lab1 Chapter 7 Java Binding Prof. Hyoung-Joo Kim OOPSLA Lab. Dept. of Computer Engineering Seoul National University.
Object-Oriented Databases (chapter 2/3) Object Persistence - Introduction Persistent Programming Languages Specifying Object Persistence via Naming and.
(Ref: ODMG2.0, R Cattell et al, Morgan Kaufmann, 1997)
Database Design Oct. 3, 2001.
Database Design Why do we need it? Consider issues such as:
OBJECTS & DATABASES Arnaud Sahuguet – CIS-550.
Object-Oriented Database Management System (ODBMS)
Object-Oriented Databases
Chapter 12 Outline Overview of Object Database Concepts
Presentation transcript:

Chapter Implementation Faithful translation of a design into a target environment Design should be free of target-environment dependencies Should generate target software algorithmically –This preserves the application model as the source and treats code as another view. –Changes should be made in the application model, not the code. –In the absence of tools to do this translation automatically, this ideal is hard to achieve.

Chapter ODMG (Object Database Management Group) Goal: Develop a standard for object databases. Approach: Transparently integrate OO languages with DBs –make the query language and the programming language one and the same –extend OO languages with persistence, concurrency control, crash recovery, and query processing –extend DBs by making objects appear like programming objects in one of several OO programming languages Components –ODL: Object Definition Language –OML: Object Manipulation Language –OQL: the query part of OML

Chapter ODMG Language Bindings Examples: C++, Smalltalk, Java Provides a representation of ODMG ODL & OML in terms of the OO language L+ Program  Executable Code –L+ Program (L+ ODL, L OML, L Auxiliary Code) –Preprocessor: L+ ODL  DB Schemes & L Declarations –Standard L Compiler: L Declarations, L OML, and L Auxiliary Code  L Object Code –Linker: L Object Code, L DB Runtime Package (provided code library)  Executable Code (which runs the application and accesses the DB)

Chapter ODMG ODL interface – names an ODL declaration extent – names the set of objects declared key[s] – declares keys persistent | transient – makes the extent persistent or transient attribute – declares an attribute readonly – makes an attribute a read-only attribute Set | List | Bag | Array – declares a collection type relationship – declares a relationship inverse – declares an inverse relationship

Chapter B&B Example – Generated Database Scheme Room(RoomNr, RoomName, NrBeds, Cost) Guest(GuestNr, GuestName, StreetNr, City) Reservation(GuestNr, RoomNr, ArrivalDate, NrDays) Room[RoomNr]  Reservation[RoomNr] Guest[GuestNr] = Reservation[GuestNr]

Chapter B&B Example – ODMG ODL Abstraction Diagram Room(RoomNr, RoomName, NrBeds, Cost) Reservation(GuestNr, RoomNr, ArrivalDate, NrDays) Guest(GuestNr, GuestName, StreetNr, City) is reserved in is for has

Chapter B&B Example – ODL for Room interface Room ( extent Rooms keys RoomNr, RoomName ): persistent { attribute Unsigned Short RoomNr; relationship Set is_reserved_in_Reservation inverse Reservation::is_for_Room; attribute String RoomName; attribute Unsigned Short NrBeds; attribute Unsigned Short Cost; }

Chapter B&B Example – ODL for Reservation interface Reservation ( extent Reservations keys (RoomNr, ArrivalDate) ): persistent { attribute Unsigned Short GuestNr; relationship Guest is_for_Guest inverse Guest::has_Reservation; attribute Unsigned Short RoomNr; relationship Room is_for_Room inverse Room::is_reserved_in_Reservation; attribute String ArrivalDate; attribute Unsigned Short NrDays; }

Chapter B&B Example – ODL for Guest interface Guest ( extent Guests keys GuestNr, (GuestName, StreetNr, City) ): persistent { attribute Unsigned Short GuestNr; relationship Reservation has_Reservation inverse Reservation::is_for_Guest; attribute String GuestName; attribute String StreetNr; attribute String City; }

Chapter OQL Basic SQL syntax: select-from-where additional flexibility –nesting: computed relations in select, from, and where clauses –expressions: path expressions, user-defined operators, use of collections such as array, list, and bag

Chapter OQL – Examples List the name and address of Guests with reservations for more than one day. select struct(x.GuestName, x.StreetNr, x.City) from x in Guest, y in x.has_Reservation where y.NrDays > 1 Is there a reservation for the Kennedy room on 13 May? exists x in Reservation : x.ArrivalDate = “13 May” and x.is_for_Room.RoomName = “Kennedy” For each room, list the cities and arrival dates of guests with reservations. select struct(x.RoomName, (select struct(y.ArrivalDate, y.is_for_Guest.City from y in x.is_reserved_in_Reservation)) from x in Room

Chapter ODMG C++ ODMG design principle: –the programmer should see only one language (not one embedded in the other) –ODMG C++ should look like C++ (as much as possible) Problems –persistence – inherit from Persistent_Object and add Ref to provide access to the instances –relationships – extend the language with an inverse clause –programmer responsibility – enforce key constraints and other integrity constraints

Chapter B&B Example – ODMG C++ Abstraction Diagram SiteOfInterest( View, Site ) Room( RoomNr, RoomName, Cost, View, Reservation(ArrivalDate, NrDays, GuestNr )* ) Guest(GuestNr, GuestName, StreetNr, City ) is for has identifies

Chapter B&B Example – ODL C++ for SiteOfInterest and Guest Classes class Room; // forward declaration class SiteOfInterest : public Persistent_Object { String View; // key Set > is_for_Room inverse Room::has_SiteOfInterest; String Site; static Ref > > SitesOfInterest; static const char * const extent_name; }; class Guest : public Persistent_Object { unsigned short GuestNr; // key String GuestName; // key (GuestName, StreetNr, City) String StreetNr; String City; static Ref > > Guests; static const char * const extent_name; };

Chapter B&B Example – ODL C++ for Room Class struct Reservation { Date ArrivalDate; unsigned short NrDays; unsigned short GuestNr; Ref identifies_Guest; }; class Room : public Persistent_Object { unsigned short RoomNr; // key String RoomName; // key unsigned short Cost; String View; Ref has_SiteOfInterest inverse SiteOfInterest::is_for_Room; Set Reservations; static Ref > > Rooms; static const char * const extent_name; };

Chapter B&B Example – OML C++ Service void GetArrivingGuestList(const Date &today) { Transaction getArrivingGuestList; Set > guests; getArrivingGuestList.begin( ); Guest::Guests = database->lookup_object(Guest::extent_name); cout << “Guests arriving on ” << today << “:” << endl; oql(guests, “select r.identifies_Guest \ from r in (select x.Reservations from x in Room) \ where r.ArrivalDate = $1”, today); ListArrivingGuests(guests); getArrivingGuestList.commit( ); }

Chapter B&B Example – OML C++ Service (cont.) #include #include “schema.hxx” static Database BandB_DB; static void ListArrivingGuests(const Collection > &guestSet) { Ref guest; Iterator > git = guestSet.create_iterator(); while(git.next(guest)) cout GuestName City << endl; } void GetArrivingGuestList(const Date &today) { … } main( ) { BandB_DB.open(“BandB”); GetArrivingGuestList(Date.current()); BandB_DB. close(“BandB”); }

Chapter OSM Development Methodology Model-Driven Development –come to understand application –transform understanding through development into code –use theory and techniques formalism – tunable, helps achieve better understanding tool support –solve problems and achieve success Check Lists –process guide (not step by step, but ordered to help) –reminder about items that may be overlooked