I33Database management OO and OR Modelling

Shared by: vps11289
-
Stats
views:
2
posted:
3/7/2010
language:
pages:
8
Document Sample
scope of work template
							                                                                 I33/Database management
                                                                     OO and OR Modelling




                               Object Oriented and
                              Object Relational Models

 Objectives

       – Discuss Object Oriented and Object Relational Data Model features
              (foils # 9-12 from previous lecture)

       – Ex. SSM model for a university DB




V99 - jcn                       I33/5 OO and OR Data Modelling                         1
                                                         I33/Database management
                                                             OO and OR Modelling




USER MODEL / Semantic Model / Graphic           ER, EER, SSM, …

Model Transformation                            Normalization GUIDELINES

DBMS MODEL / Schema                             RM ----> ORM <---- OOM
Tabular, DDL (Data Definition Language)         SQL2 SQL3          ODL



                USER                           DBMS
               schema                          schema


                                  Q
                                              M-DBMS          DB
                                  L


V99 - jcn               I33/5 OO and OR Data Modelling                        2
                                                                    I33/Database management
                                                                        OO and OR Modelling


DBMS MODEL / Schema                                     RM ----> ORM <---- OOM
Tabular, DDL (Data Definition Language)                 SQL2 SQL3          ODL

               Relational DBMS                          Object-Relational DBMS

    Query & Transaction Processing                          Query Processing
            Simple Data                                      Complex Data

                     100                                         150 (2005)

                  File System                             Persistent Language
                                                        Object Data Management
            No queries, Simple Data
                 (text editor)                                   No queries
                     100+                                            1
                                  [ Stonebraker '99, pg.26 ]

V99 - jcn                       I33/5 OO and OR Data Modelling                           3
                                                                I33/Database management
                                                                    OO and OR Modelling


            OO-concept                    Equivalent concept (RDBS, SSM)

      Persistent data          =          stored data (database)

      Object                   @          relation (entity)

      OID                                primary key

      complex object                     attributes, nested structures,
                                          abstract data types

      object behavior                    trigger, procedure, rule

      (operation / method)                derived attribute, function




V99 - jcn                    I33/5 OO and OR Data Modelling                          4
                                                           I33/Database management
                                                               OO and OR Modelling


            OO-concept                Equivalent concept (RM,EER)

      object type          =          relation scheme, entity type

      object class         @          relation extension

      Inheritance          =          specialization hierarchy

      encapsulation                  data independence

      polymorphism                    -



      schema evolution     =          schema evolution

      new attributes, operations     DB reorganization



V99 - jcn                I33/5 OO and OR Data Modelling                         5
                                                               I33/Database management
                                                                   OO and OR Modelling




PERSON                                             COURSE
 Pid:        dec(11)                                Cid:               Ccode
 Name:       (l-name,f-name): string                Level:             integer
 Position:   array(2) [S,T,O]: char                 Description:       TBLOB
 Picture:    Image                                  Participants       *Student
 Uid:        User
                                                   Size ():          integer
                                                   Select_course (phrase): *course
STUDENT
 Level: integer
 Takes *(Course,
        grade: dec, date: date)




V99 - jcn                   I33/5 OO and OR Data Modelling                          6
                                                                 I33/Database management
                                                               OO Modelling - Relationships
                                                                           OODDL[EN94]




Define class Person:
     type tuple    (<attr-def>,  Ed:   set tuple ( degree: string, school: string, …),
                                 UiD:  User );
Define class Student inherit Person:
     type tuple    (<attr-def>, Takes: set tuple (course: course, grade: dec (2.1), ...);
Define class Course:
     type typle   (<attr-def>, Students: set (Students) );


V99 - jcn                    I33/5 OO and OR Data Modelling                              7
                                                     I33/Database management
                                                                OR Modelling
                                                                       SB’99

                 Create table Person (              ----- SQL2 (+DBMS’97) --
                      Pid          numeric (11)           not null ,
                      Name         varchar (30) ,
                      Age          integer ,
                      Picture BLOB ,                /* Binary Large Object */
                 --------------------------------------- SQL3 ------------------
                      Address AS ( Street                 varchar (30), …,
                                            P-code        P_code ,
                                            Location point ) ,
                      Position set ( Position_code) ,
                      Education set ( ref (Ed-Background) );
                 Create rule      Age ON select Person DO
                                 Age = Current_data - Birthdate;
                 Create function distance (point loc-1, point loc-2)
                     returning integer          AS ArcInfo (distance) ;

V99 - jcn   I33/5 OO and OR Data Modelling                                     8

						
Related docs