lec13.366

lec13.366 - . . Winter 2008 CPE/CSC 366: Database Modeling,...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: . . Winter 2008 CPE/CSC 366: Database Modeling, Design and Implementation Alexander Dekhtyar . . Object-Oriented and Object-Relational Data Models Object-Oriented Data Model Overview ODL O bject D efinition L anguage. Basic notions: Classes ; Attributes ; Relationships ; Methods ; Exceptions ; C/C++ -style syntax. Complex type system. ODL Syntax Classes. class <name> { <list of properties> } Referencing a property: <class>::<property> Attributes. Simplest of properties. attribute <type description> <name> 1 Type descriptions can be simple ( string, integer, enum ) of complex ( Struct, List, Set ). Relationships. Another type of properties. Established between different classes. relationship <class description> <name> Relationships are treated as references . Name is the name of the attribute for storing the reference(s). Class description specifies the type of the reference collection (single reference, set, list, etc. . . ) and the name of the class to the objects of which the references would point. Inverse Relationships. relationship <class description> <name> inverse <class>::<relationship name> Example 1 Descriptions of classes for the Library database. class Book { attribute string ID; attribute integer ISBN; attribute string Title; relationship Set<Author> Authors inverse Author::wrote; relationship PubCompany publisher inverse PubCompany::Books; attribute integer year; } class Author { attribute string Name; attribute string Country; relationship Set<Book> wrote inverse Book::Authors; } class PubCompany { attribute string Name; attribute Struct { string street, string city, integer zip, string country, } Headquaters; relationship Set<Book> Books inverse Book::publisher; } Types of relationships. Class A Class B Class B Class A Type of relationship A B B A one-to-one A Set < B > B A one-to-many A B B Set < A > many-to-one A Set < B > B Set < A > many-to-many 2 Methods Third type of properties. Signatures of methods, similar to C/C++ declarations. <type> <Name> (<parameters>) [ raises (<Exceptions>)] Parameters: in , out , inout . Exceptions: Types Atomic (simple) types . integer , float , char , string boolean , enum ....
View Full Document

Page1 / 8

lec13.366 - . . Winter 2008 CPE/CSC 366: Database Modeling,...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online