{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

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

View Full Document Right Arrow Icon
. . 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
Image of page 1

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

View Full Document Right Arrow Icon
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
Image of page 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 , stringboolean , enum . Class Names . E.g., Book is a type. Structured Types : Set ; Bag or multiset; List (position important); Array : Array < Type,i > .
Image of page 3

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

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern