# Chapter 1
# Chapter 1
Database Systems
• Complex Objects
4
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
History of OO Models and Systems
• Programming Languages:
• Simula (1960’s)
• Smalltalk (1970’s)
• C++ (late 1980’s)
• Java (1990’s and 2000’s)
5
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
History of OO Models and Systems
• Experimental Systems:
• Orion at MCC
• IRIS at H-P labs
• Open-OODB at T.I.
• ODE at ATT Bell labs
• Postgres - Montage - Illustra at UC/B
• Encore/Observer at Brown
6
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
History of OO Models and Systems
• Commercial OO Database Products:
• Ontos
• Gemstone
• O2 ( -> Ardent)
• Objectivity
• Objectstore ( -> Excelon)
• Versant
• Poet
• Jasmine (Fujitsu – GM)
7
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Overview of Object-Oriented Concepts
• Main Claim:
OO databases try to maintain a direct correspondence between real-world
and database objects so that objects do not lose their integrity and
identity and can easily be identified and operated upon
• Object:
Two components:
• State (value) and behavior (operations)
9
Estifanos T. (MSc in Computer Networking) 8
Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Overview of Object-Oriented Concepts
10
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Overview of Object-Oriented Concepts
11
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Overview of Object-Oriented Concepts
1212
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Overview of Object-Oriented Concepts
1313
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Overview of Object-Oriented Concepts
• Operator Polymorphism:
1414
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Object Identity, Object Structure, and
Type Constructors
• Unique Identity:
• An OO database system provides a unique identity to each
independent object stored in the database
• This unique identity is typically implemented via a unique, system-
generated object identifier, or OID
• The main property required of an OID is that it be immutable
• Specifically, the OID value of a particular object should not
change
• This preserves the identity of the real-world object being
represented
15
• Type Constructors:
• In OO databases, the state (current value) of a complex object
may be constructed from other objects (or other values) by
using certain type constructors
• The three most basic constructors are atom, tuple, and set
• Other commonly used constructors include list, bag, and
array
• The atom constructor is used to represent all basic atomic
values, such as integers, real numbers, character strings,
Booleans, and any other basic data types that the system
supports directly
1616
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Object Identity, Object Structure, and
Type Constructors
• Example 1
• One possible relational database state corresponding to
COMPANY schema
1717
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Object Identity, Object Structure, and
Type Constructors
1818
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Object Identity, Object Structure, and
Type Constructors
1919
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Object Identity, Object Structure, and
Type Constructors
2020
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Object Identity, Object Structure, and
Type Constructors
2121
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Object Identity, Object Structure, and
Type Constructors
• The first six objects listed in this example represent atomic values
2222
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Object Identity, Object Structure, and
Type Constructors
• Example 2
• This example illustrates the difference between the two
definitions for comparing object states for equality
• o1 = (i1, tuple, <a1:i4, a2:i6>)
• o2 = (i2, tuple, <a1:i5, a2:i6>)
• o3 = (i3, tuple, <a1:i4, a2:i6>)
• o4 = (i4, atom, 10)
• o5 = (i5, atom, 10)
• o6 = (i6, atom, 20)
2323
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Object Identity, Object Structure, and
Type Constructors
2424
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
2525
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Object Identity, Object Structure, and
Type Constructors
26 26
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Encapsulation of Operations, Methods,
and Persistence
• Encapsulation
• One of the main characteristics of OO languages and systems
• Related to the concepts of abstract data types and information
hiding in programming languages
2727
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Encapsulation of Operations, Methods,
and Persistence
• Specifying Object Behavior via Class Operations:
• The main idea is to define the behavior of a type of object based
on the operations that can be externally applied to objects of that
type
• In general, the implementation of an operation can be specified in
a general-purpose programming language that provides flexibility and
power in defining the operations
2828
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Encapsulation of Operations, Methods,
and Persistence
• Specifying Object Behavior via Class Operations (contd.):
• For database applications, the requirement that all objects be
completely encapsulated is too stringent
• One way of relaxing this requirement is to divide the
structure of an object into visible and hidden attributes
(instance variables)
2929
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Encapsulation of Operations, Methods, and Persistence
3030
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Encapsulation of Operations, Methods,
and Persistence
• Specifying Object Persistence via Naming and Reachability:
• Naming Mechanism:
• Assign an object a unique persistent name through which it can be
retrieved by this and other programs
• Reachability Mechanism:
• Make the object reachable from some persistent object
• An object B is said to be reachable from an object A if a sequence of
references in the object graph lead from object A to object B
3131
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Encapsulation of Operations, Methods,
and Persistence
• Specifying Object Persistence via Naming and Reachability (contd.):
3232
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Encapsulation of Operations, Methods, and Persistence
33
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Type and Class Hierarchies and
Inheritance
• Type (class) Hierarchy
• A type in its simplest form can be defined by giving it a type name
and then listing the names of its visible (public) functions
• When specifying a type in this section, we use the following
format, which does not specify arguments of functions, to
simplify the discussion:
• TYPE_NAME: function, function, . . . , function
• Example:
• PERSON: Name, Address, Birthdate, Age, SSN
34
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Type and Class Hierarchies and
Inheritance
• Subtype:
• When the designer or user must create a new type that is
similar but not identical to an already defined type
• Supertype:
• It inherits all the functions (attributes and methods) of the
subtype
35
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Type and Class Hierarchies and
Inheritance
• Example (1):
• PERSON: Name, Address, Birthdate, Age, SSN
• EMPLOYEE: Name, Address, Birthdate, Age, SSN, Salary,
HireDate, Seniority
• STUDENT: Name, Address, Birthdate, Age, SSN, Major, GPA
• OR:
• EMPLOYEE subtype-of PERSON: Salary, HireDate, Seniority
• STUDENT subtype-of PERSON: Major, GPA
36
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Type and Class Hierarchies and
Inheritance
• Example (2):
• Consider a type that describes objects in plane geometry, which may be
defined as follows:
• GEOMETRY_OBJECT: Shape, Area, ReferencePoint
• Now suppose that we want to define a number of subtypes for the
GEOMETRY_OBJECT type, as follows:
• RECTANGLE subtype-of GEOMETRY_OBJECT: Width, Height
• TRIANGLE subtype-of GEOMETRY_OBJECT: Side1, Side2,
Angle
• CIRCLE subtype-of GEOMETRY_OBJECT: Radius
37
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Type and Class Hierarchies and
Inheritance
• Example (2) (contd.):
• An alternative way of declaring these three subtypes is to
specify the value of the Shape attribute as a condition that
must be satisfied for objects of each subtype:
• RECTANGLE subtype-of GEOMETRY_OBJECT
(Shape=‘rectangle’): Width, Height
• TRIANGLE subtype-of GEOMETRY_OBJECT
(Shape=‘triangle’): Side1, Side2, Angle
• CIRCLE subtype-of GEOMETRY_OBJECT
(Shape=‘circle’): Radius
38
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Type and Class Hierarchies and
Inheritance
• Extents:
• In most OO databases, the collection of objects in an extent
has the same type or class
• However, since the majority of OO databases support types, we
assume that extents are collections of objects of the same type
for the remainder of this section
• Persistent Collection:
• This holds a collection of objects that is stored permanently in
the database and hence can be accessed and shared by multiple
programs
• Transient Collection:
• This exists temporarily during the execution of a program but is
not kept when the program terminates
39
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Complex Objects
• Unstructured Complex Object:
• These is provided by a DBMS and permits the storage and
retrieval of large objects that are needed by the database
application
• Typical examples of such objects are bitmap images and long text
strings (such as documents); they are also known as binary large
objects, or BLOBs for short
• This has been the standard way by which Relational DBMSs
have dealt with supporting complex objects, leaving the
operations on those objects outside the RDBMS
40
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Complex Objects
• Structured Complex Object:
• This differs from an unstructured complex object in that
the object’s structure is defined by repeated application
of the type constructors provided by the OODBMS
• Hence, the object structure is defined and known to the
OODBMS
• The OODBMS also defines methods or operations on it
41
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Other Objected-Oriented Concepts
• Polymorphism (Operator Overloading):
• This concept allows the same operator name or symbol to
be bound to two or more different implementations of
the operator, depending on the type of objects to which
the operator is applied
• For example + can be:
• Addition in integers
• Concatenation in strings (of characters)
42
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Other Objected-Oriented Concepts
• Multiple Inheritance and Selective Inheritance
• Multiple inheritance in a type hierarchy occurs when a
certain subtype T is a subtype of two (or more) types and
hence inherits the functions (attributes and methods) of both
supertypes
• For example, we may create a subtype
ENGINEERING_MANAGER that is a subtype of both
MANAGER and ENGINEER
• This leads to the creation of a type lattice rather than a type
hierarchy
43
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Other Objected-Oriented Concepts
• Versions and Configurations
• Many database applications that use OO systems require
the existence of several versions of the same object
• There may be more than two versions of an object
• Configuration:
• A configuration of the complex object is a collection
consisting of one version of each module arranged in such
a way that the module versions in the configuration are
compatible and together form a valid version of the complex object
44
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Summary
• Object Identity:
• Objects have unique identities that are independent of their
attribute values
• Type Constructors:
• Complex object structures can be constructed by
recursively applying a set of basic constructors, such as
tuple, set, list, and bag
• Encapsulation Of Operations:
• Both the object structure and the operations that can be
applied to objects are included in the object class
definitions
45
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Summary
• Programming Language Compatibility:
• Both persistent and transient objects are handled uniformly.
Objects are made persistent by being attached to a persistent
collection
• Type Hierarchies And Inheritance:
• Object types can be specified by using a type hierarchy, which
allows the inheritance of both attributes and methods of
previously defined types
• Extents:
• All persistent objects of a particular type can be stored in an
extent. Extents corresponding to a type hierarchy have set/subset
constraints enforced on them 46
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Summary
• Support For Complex Objects:
• Both structured and unstructured complex objects can be
stored and manipulated
• Polymorphism And Operator Overloading:
• Operations and method names can be overloaded to apply
to different object types with different implementations
• Versioning:
• Some OO systems provide support for maintaining several
versions of the same object
47
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
Contemporary Status
• OODB market growing very slowly these days
• O-O ideas are being used in a large number of applications,
without explicitly using the OODB platform to store data
• Growth:
• O-O tools for modeling and analysis, O-O Programming
Languages like Java and C++
• Compromise Solution Proposed:
• Object Relational DB Management (Informix Universal
Server, Oracle 10i, IBM’s UDB, DB2/II …)
48
Estifanos T. (MSc in Computer Networking) Lecture 1: Concepts for Object-Oriented Databases 6/29/2018
End Of
Chapter One
???