Object Definition Language

Slides:



Advertisements
Similar presentations
Chapter 6: Entity-Relationship Model (part I)
Advertisements

Why Object-Oriented DBMS? Abstract data types Interface with host programming language (the impedance mismatch). Object identity: (peter, 40, {(john, 15,
Winter 2002Arthur Keller – CS 18015–1 Schedule Today: Feb. 28 (TH) u Datalog and SQL Recursion, ODL. u Read Sections , Project Part 6.
Fall 2001Arthur Keller – CS 18015–1 Schedule Nov. 15 (TH) Object Queries (OQL). u Read Sections 9.1. Project Part 6 due on Sunday night. Nov. 20 (T) More.
Winter 2002Arthur Keller – CS 18016–1 Schedule Today: Mar. 5 (T) u More ODL, OQL. u Read Sections 9.1. Assignment 7 due. Mar. 7 (TH) u More OQL. u Read.
Chapter 15 (Web): Object-Oriented Database Development
1 Other High-Level Design Languages Unified Modeling Language Object Description Language.
Programs with SQL Host language + Embedded SQL Preprocessor Host Language + function calls Host language compiler Host language program Preprocessor Host.
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,
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.
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.
Chapter 21 A Object Data Model - Intro Copyright © 2004 Pearson Education, Inc.
©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)
Object Definition Language
By: Richard Fleischman & Sharon Young Advanced Data Models.
Object Definition Language
Databases Illuminated
Database Design Why do we need it? – Agree on structure of the database before deciding on a particular implementation. Consider issues such as: –What.
Object Oriented Analysis and Design Class and Object Diagrams.
© D. Wong Security and User Authorization in SQL 8.7 pp. 410  Authorization ID = user name  Special authorization ID: PUBLIC  Privileges for:
1. 2 Standards group: ODMG = Object Data Management Group. ODL = Object Description Language, like CREATE TABLE part of SQL. OQL = Object Query Language,
ER Diagrams and Relational Model CS 174a (Winter 2015)
Chapter 2: Entity-Relationship Model
CS422 Principles of Database Systems Entity-Relationship Model
Comp 1100 Entity-Relationship (ER) Model
Why Object-Oriented DBMS?
Databases (CS507) CHAPTER 7.
Entity-Relationship Model
Enhanced Entity-Relationship (EER) Model
Object-Oriented Databases and the ODMG Standard
Modeling Constraints Extracting constraints is what modeling is all about. But how do we express them? Examples: Keys: social security number uniquely.
© Shamkant B. Navathe CC.
Entity-Relationship Model
Entity Relationship Model
EER Model – Chapter
Session 2 Welcome: The sixth learning sequence
Enhanced Entity-Relationship (EER) Modeling
(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.
Entity-Relationship Model
Chapter 2: Entity-Relationship Model
ER Diagram Practical Example
Chapter 12 Outline Overview of Object Database Concepts
Chapter 2: Entity-Relationship Model
Chapter 10 Thinking in Objects
Lec 3: Object-Oriented Data Modeling
© Shamkant B. Navathe CC.
Entity-Relationship Model
ISC321 Database Systems I Chapter 10: Object and Object-Relational Databases: Concepts, Models, Languages, and Standards Spring 2015 Dr. Abdullah Almutairi.
Chapter Entity-Relationship Modeling & Enhanced Entity- Relationship Modeling.
© Shamkant B. Navathe CC.
CS4222 Principles of Database System
Chapter 6: Entity-Relationship Model
Lecture 5: The Relational Data Model
Sampath Jayarathna Cal Poly Pomona
Chapter Entity-Relationship Modeling & Enhanced Entity- Relationship Modeling.
Chapter 15: Object-Oriented Database Development
Sampath Jayarathna Cal Poly Pomona
Enhanced Entity-Relationship (EER) Modeling
CSC Database Management Systems
Enhanced Entity-Relationship (EER) Modeling
Object-Oriented DBMS’s
Chapter 2: Entity-Relationship Model
Entity-Relationship Modelling
Presentation transcript:

Object Definition Language Design language derived from the OO community: Can be used like E/R as a preliminary design for a relational DB. CORBA ODMG ODL (design OQL (queries Relational design ODL OODMBS input

ODL Class Declarations Element Declarations Method Example interface < name > {elements = attributes, relationships, methods } Element Declarations attribute < type > < name > ; relationship < rangetype > < name > ; Method Example float gpa(in: Student) raises(noGrades) float = return type. in: indicates Student argument is read-only. Other options: out, inout. noGrades is an exception that can be raised by method gpa.

Banking Example 1 Keys: ss#, loanid, branchid name amount loandid address type borrower customer loans Belongs-to Customer-of branch branchid location Keys: ss#, loanid, branchid Cardinality constraint: each loan belongs to a single branch

Banking Example (II) interface Customer { attribute string name; attribute integer ss#; attribute Struct Addr {string street, string city, int zip} address; relationship Set<Loans> borrowed inverse Loans::borrower; relationship Set<Branch> has-account-at inverse Branch:patrons; key(ss#) } Structured types have names and bracketed lists of field-type pairs. Relationships have inverses. An element from another class is indicated by < class > :: Form a set type with Set<type>.

Loans Example (III) interface loans { attribute real amount; attribute int loanid; attribute Enum loanType {house, car, general} type; relationship Branch belongs-to inverse Branch::loans-granted; relationship Set<Customer> borrower inverse Customer::borrowed; key(loanid) } Enumerated types have names and bracketed lists of values.

Bank Example (IV) interface Branch { attribute integer branchid; attribute Struct Customer::Addr location; relationship Set<Loans> loans-granted inverse Loans::belongs-to; relationship Set<Customer> patrons inverse Customer::has-account-at; key(branchid); } Note reuse of Addr type.

ODL Type System Basic types: int, real/ float, string, enumerated types, and classes. Type constructors: Struct for structures and four collection types: Set, Bag, List, and Array.

Limitations on Nesting Relationship class collection Attribute Basic, no class struct collection

ER versus ODL E/R: arrow pointing to “one. ODL: don't use a collection type for relationship in the “many" class. Collection type remains in “one.” E/R: arrows in both directions. ODL: omit collection types in both directions ODL only supports binary relationship. Convert multi-way relationships to binary and then represent in ODL create a new connecting entity set to represent the rows in the relationship set. Problems handling cardinality constraints properly!!

Roles in ODL No problem; names of relationships handle roles.” manager interface employee { attribute string name; relationship Set<Employee> manager inverse Employee::worker; relationship Set<Employee> worker inverse Employee::manager } manager works for employee worker

Subclasses in ODL Subclass = special case = fewer entities/objects = more properties. Example: Faculty and Staff are subclasses of Employee. Faculty have academic year (9 month salaries) but staff has a full-year (12 month salary).

ODL Subclasses Follow name of subclass by colon and its superclass. interface Faculty:Employee { attribute real academic-year-salary; } Objects of the Faculty class acquire all the attributes and relationships of the Employee class. Inheritance in ODL and ER model differ in a subtle way in ODL an object must be member of exactly one class in ER an object can be member of more than one class

Keys in ODL Indicate with key(s) following the class name, and a list of attributes forming the key. Several lists may be used to indicate several alternative keys. Parentheses group members of a key, and also group key to the declared keys. Thus, (key(a1; a2; : : : ; an )) = “one key consisting of all n attributes." (key a1; a2; : : : ; an ) =“each ai is a key by itself. Keys are not necessary for ODL. Object identity and not keys differentiates objects