300 likes | 499 Views
Chapter 11 Object-Oriented Databases. Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel. Object Schemas: The Graphical Representation of Objects. Figure 11.14 Shared Representation For All Objects Of the Class Person.
E N D
Chapter 11Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel
Object Schemas: The Graphical Representation of Objects Figure 11.14 Shared Representation For All Objects Of the Class Person
State Of A Person Object Instance Figure 11.15
Defining Three Abstract Data Types Figure 11.16
Object Representation For Instances Of The Class Person With ADTs Figure 11.17
Object Schemas: The Graphical Representation of Objects • The object space or object schema is the equivalent of a database schema or a relational schema at a given time. Figure 11.18
Object Schemas: The Graphical Representation of Objects • Class-Subclass Relationships Figure 11.20 Class Hierarchy
Employee Object Representation Figure 11.21
Object Schemas: The Graphical Representation of Objects • Interobject Relationships: Attribute-Class Link • A attribute-class or interobject relationship is created when an object’s attribute references another object of the same or different class. • Relationship Representation: • Representing 1:M Relationships • Representing M:N Relationships • Representing M:N Relationships with an Intersection Class
Class Hierarchy For The EDLP Retail Corporation Figure 11.22
Object Schemas: The Graphical Representation of Objects • Representing 1:M Relationships • Related classes are enclosed in boxes to make relationships more noticeable. • The double line on the box’s right side indicates that the relationship is mandatory. • Connectivity is indicated by labeling each box.
Representing The 1:M Relationship Figure 11.23
Representing The 1:1 And 1:M Relationships Figure 11.24
Employee-Dependent Relationship Figure 11.25
Object Schemas: The Graphical Representation of Objects • Representing M:N Relationships Figure 11.26
Object Schemas: The Graphical Representation of Objects • Representing M:N Relationships with an Intersection Class Figure 11.27 Representing the M:N Relationship With Associated Attributes
Representing The M:N Relationship With Intersection Class Figure 11.28
Object Schemas: The Graphical Representation of Objects • Late and Early Binding: Use and Importance • With late binding the data type of an attribute is not known until execution time or run-time. • Late binding allows two different object instances of the same class to contain values of different data types for the same attribute. • Early binding allows the database to check the data type for each of the attribute’s values at compilation or definition time.
Inventory Table With Predetermined (Base) Data Types Figure 11.30
Inventory Class With Early Binding Figure 11.31
OODM Inventory Class With Late Binding Figure 11.32
Object Schemas: The Graphical Representation of Objects • Support for Versioning • Versioning is an OODM feature that allows us to track the history of change in the state of an object. • It is a very powerful modeling feature, especially in a CAD environment.
OODM and Previous Data Models • Object, Entity, and Tuple • An OODM object has additional characteristics such as behavior, inheritance, and encapsulation. • Such characteristics make OO modeling much more natural than E-R and relational modeling.
An Invoice Representation Figure 11.33
OODM and Previous Data Models • Class, Entity Set, and Table • Class is a more powerful concept that allows not only the description of the data structure but also the description of the behavior. • A class allows both the concept and the implementation of abstract data types. • Encapsulation and Inheritance • An object belonging to a class inherits all the properties of its superclasses. • Encapsulation hides the data representation and the method’s implementation from other objects and the user.
OODM and Previous Data Models • Object ID • Object ID is not supported in either the E-R model or the relational model. • The hierarchical and the CODASYL models support some form of ID. • Relationships • Relationships in an OODM can be of two types: interclass references or class hierarchy inheritance. • E-R and relational models use a value-based relationship approach.
OODM and Previous Data Models • Access • E-R and relational models use an ad hoc, set-oriented query language. • OODM is suited to support both navigational and set-oriented access.