Title: Object Database Management Systems
1Object Database Management Systems
2Chapters Covered
- Third edition
- Chapter 24 except 24.4, 24.5
- Chapter 25 except 25.2.1, 25.3, 25.4.4-25.6
- Fourth edition
- Chapter 25 except 25.4, 25.5, 25.7
- Chapter 26 except 26.1.2, 26.1.4, 26.3, 26.4.4
26.5
3The Necessity of a New Data Model
- Advanced applications require
- Complex data types
- New operations
- Recursive queries
- Impedance mismatch
- RDBMS problems
- Evolution of computer applications
4Recursive Query
- Recursion in OO programming language
- Static long fact(int n)
- Assert.notFalse((ngt0 (nlt10))
- return nfact(n-1)
- Recursion in relational algebra and SQL
- The need to know the number of levels
5Impedance Mismatch
- Mixing different programming paradigms
- Declarative and procedural programming languages
- Different data representation
- Data conversion
- Difficulties with automatic code checking
- The necessity to provide seamless integration
between application program and a database
6Object-Oriented Concepts
- Abstraction.
- Objects and attributes.
- Object identity.
- Methods and messages.
- Classes and inheritance.
- Polymorphism and dynamic binding.
7Abstraction
- Process of identifying essential aspects of an
entity and ignoring unimportant properties. - Concentrate on what an object is and what it
does, before deciding how to implement it. - Main aspects
- Encapsulation
- Information hiding
8Encapsulation and Information Hiding
- Encapsulation - Object contains both data
structure and set of operations used to
manipulate it. - Information hiding
- External aspects
- Internal details
- Logical data independence
9Object
- Uniquely identifiable entity
- Object state
- Object attributes (instance variables)
- Simple attribute
- Complex attribute
- Collection attribute
- Reference attribute
10Object Identity - OID
- System-generated
- Unique to the object
- Invariant during the object lifetime
- Independent of the object state
- Invisible for users
11Object Identity
- Objects are identical if3 they have the same OIDs
- Objects equality
- Shallow equality all attributes except
references contain the same values - Deep equality Object states contain the same
values and related object states also contain the
same values
12Object Behavior
- Methods operations with object attributes
- Method components
- Method name
- Block of code that implements required operations
13Communication of Objects
- Message a request from one object to another
asking second object to execute one of its
methods. - An object can send a message to itself
14Abstract Data Type (ADT)
- User-defined data type that describes similar
objects - Contains
- Data structure - attributes
- Set of methods that realize the interface
15Classes
- Objects that have the same attributes and respond
to the same messages form a class - An object is an instance of its class
- A class may have
- Class attributes
- Class methods
16Inheritance
- Allows one class of objects to be defined as a
special case of a more general class. - Superclasses and subclasses
- Subclass inherits all properties of its
superclass and can define its own unique
properties. - Subclass can redefine inherited methods.
17Class Hierarchy
- A class can be a superclass and a subclass at the
same time - Inheritance
- Single inheritance
- Multiple inheritance
- Conflicts
- No single approach to conflict resolution
- Method overriding
18Polymorphism
- Allows different objects to respond to same
messages in different ways - Inclusion polymorphism
- Operation polymorphism overloading
- Parametric polymorphism
- Binding - process of selecting appropriate method
based on an objects type. - Dynamic (late) binding
19The Object Data Model
- Basic modeling constructs objects and literals
- Objects and literal are categorized into types.
- Object behavior is defined by a set of methods
(operations) - Object state is defined by the values of objects
set of properties - An ODMS stores objects based on a schema defined
in the ODL
20Object Properties
- Properties (attributes)
- Simple (atomic)
- Complex
- Composite
- Multi-valued
- Relationships
- Type constructors
21Object-oriented vs. Relational Data Models
OODM RDM Difference
Object Entity Object includes behavior
Attribute Attribute Complex attributes
Association Relationship -
Message N/A -
Class Entity Set Class attributes and methods
Instance Entity (instance) -
Encapsulation N/A -
OID Primary key OID is state independent
22ODM Diagrammatic Representation
- Class diagram
- Class representation
- Class name
- Properties
- Methods operations
- Associations
- Object diagram
23Classes
- Generalization
- Specialization
- Inheritance
- Abstract class a class that has no direct
instances - Concrete class a class that can have direct
instances
24Inheritance Constraints
- Complete no additional subclasses are expected
- Incomplete additional subclasses may be
required
25Relationships in ODM
- Inheritance (Is a)
- Other types of relationships
- Association
- Aggregation
- Composition
- Inverse relationships
26Associations
- Named relationships between or among object
classes - Association role the end of association where
it connects to the class - Each association has two roles
- Degree of an association
- Association implementation
27Representation of Association
- ODM supports only binary relationships
- Cardinality (connectivity) the number of
possible objects playing one role that may relate
to a single object playing another role - 11
- 1
-
- Associations of a degree higher than two
28Intermediate (Association) Class
- Cardinality is determined as
- Association has some attributes
- Association itself can participate in a
relationship with other class - Representing associations of a degree higher than
two - Intermediate class contains references to
corresponding classes and descriptive attributes
29Aggregation and Composition (Has a)
- Aggregation - a part-of relationship between a
component object and an aggregate object - Aggregation vs. inheritance
- Composition an aggregation in which a part
object belongs to only one whole object and the
part object lifetime is the same as lifetime of
the whole object
30Behavioral Design
- State vs. behavior
- Public and private methods
- Main types of methods
- Constructors and destructors
- Access query operation
- Transform update operation
- Derived attributes in ERD
31Implementation of Object Data Model
- OODM data model that expresses the semantics of
objects in OO programming language - OODB persistent and sharable collection of
objects defined by OODM - OODBMS software that manages an OODB
32Two Main Approaches
- Include persistence into object-oriented
programming languages - Persistent objects
- Transient objects.
- Extend standards of relational DBMSs to include
some of object-oriented concepts - ORDBMS
33Persistent Programming Language
- Preserves data across successive executions of a
program - Data is independent of any program
- Data exists beyond the execution and lifetime of
the code that created it - Eliminates impedance mismatch by extending
programming language with database features.
34Two-Level Storage Model
35Single-Level Storage Model
36OID in Single-Level Storage Model
- OID in C is physical address in the process
memory space - Logical OID independent of physical location of
the object - Physical OID describes the location of the
object - Pointer swizzling the conversion of OIDs to
main memory pointers, and back
37Accessing an Object (Entity) in RDBMS
38Accessing an Object in OODBMS
39Data Management Aspects in OODBMS
- Long-Duration Transactions in OODBMS
- An object is the unit of concurrency control
- An object is a unit of recovery
- Advanced transaction models
- Multiversion concurrency control protocols
40Versions
- Identifiable state of the object
- Version management
- Version history
- Object references always point to correct object
version.
41Schema Evolution (Modification)
- Changes to class definition
- Modifying Attributes.
- Modifying Methods.
- Changes to class hierarchy
- Making class S a superclass of class C.
- Removing S from list of superclasses of C.
- Modifying the order of superclasses of C.
- Changes to set of classes
- Creating and deleting classes
- Modifying class names