Professional Documents
Culture Documents
ADMS Chapter One
ADMS Chapter One
ADMS Chapter One
Data integration
Querying (SQL)
Introduction – Types of Database
Hierarchical/Network Database Model
Suitable for data which are related
Relational Database
Provides a conceptually simple model for data as relations
(typically considered “tables”) with all data visible.
Introduction – Types of Database
Object Oriented Database Model
Goal:
Store object-oriented programming objects in a
database without having to transform them into
relational format
OODB were not commercially successful due to
high cost of relational to object-oriented transformation
and a sound underlying theory, but they still exist
as mentioned creating a standard.
ER Data Model
Persistent objects
An object which exists even after the program is
completely executed (or terminated), is called as
persistent objects. Object-oriented databases can
store objects in secondary memory.
In other words, OO databases store persistent
objects permanently in secondary storage, and
allow the sharing of these objects among multiple
programs and applications
Object Identity
One goal of an ODMS (Object Data Management
System) is to maintain a direct correspondence
between real-world and database objects so that
objects do not lose their integrity and identity.
Hence, an ODMS provides a unique identity to
each independent object stored in the database
Each object is assigned an Object Identifier
(OID) when it is created that is:
system generated
unique to that object
immutable / invariant/ unchanged
independent of the values of its attributes
indivisible to the user
used only once.
Object Structure
Similar to Object Oriented Programming, OODB
objects can be constructed from other object
constructors.
An object can be defined as a triple (i,c,v) . Where
i is the object identifier,
c is the type constructor, and
v is the state or value of the object.
Type Constructors
In ODMS objects and literals may have a type structure
of arbitrary complexity in order to contain all of the
necessary information that describes the object
The three most basic type constructors (types) are
atom, tuple, and collection.
Atom Constructor
One type constructor has been called the atom constructor,
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.
They are called single-valued or atomic types, since each
value of the type is considered an atomic (indivisible) single
value.
Type Constructors
Tuple (Struct) constructor
struct (or tuple) constructor. This can create standard structured
types, such as the tuples (record types) in the basic relational
model.
A structured type is made up of several components, and is also
sometimes referred to as a compound or composite type.
For example, two different structured types that can be created are:
struct Name<FirstName: string,
MiddleInitial: char,
LastName: string>,
struct CollegeDegree <Major: string,
Degree: string,
Year: date>
Type Constructors
Collection (or multivalued) Constructor
Collection constructors include the set(T), list(T), bag(T),
array(T), and dictionary(K,T) type constructors.
These allow part of an object or literal value to include a
collection of other objects or values when needed.
These constructors are also considered to be type
generators because many different types can be created.
For example,
set(string), set(integer), and set(Employee) are three
different types that can be created from the set type
constructor. All the elements in a particular collection
value must be of the same type. For example, all values in
a collection of type set(string) must be string values.
Type Constructors
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.
The tuple constructor can create structured values
and objects of the form <a1:i1, a2:i2,...,an:in>, where
each aj is an attribute name and each ij is a value or
an OID
The other commonly used constructors are collectively
referred to as collection types, but have individual
differences among them.
Type Constructors
The set constructor will create objects or literals that are a set
of distinct elements {i1,i2,...,in},all of the same type.
The bag constructor (sometimes called a multiset) is similar to
a set except that the elements in a bag need not be distinct.
The list constructor will create an ordered list [i1,i2,...,in] of
OIDs or values of the same type.
A list is similar to a bag except that the elements in a list are
ordered, and hence we can refer to the first, second, or jth
element.
The array constructor creates a single-dimensional array of
elements of the same type. The main difference between array
and list is that a list can have an arbitrary number of elements
whereas an array typically has a maximum size.
The dictionary constructor creates a collection of two tuples
(K, V), where the value of a key K can be used to retrieve the
corresponding value V.
Type Constructors
Object state interpreted by object constructors
Object Structure
Object structure can be defined by constructor
Atomic
Structured (tuple)
Collection : set , List , bag, array
Example
i1, i2, i3, . . . to stand for unique system generated object identifiers. Consider
the following objects:
o1 = (i1, atom, ‘AddisAbaba’)
o2 = (i2, atom, ‘Jemo’)
o3 = (i3, atom, ‘Jimma’)
o4 = (i4, atom, 5)
o5 = (i5, atom, ‘Research’)
o6 = (i6, atom, ‘1988-05-22’)
o7 = (i7, set, {i1, i2, i3})
Object Structure
Example 1 (cont.)
The first six objects listed in this example
represent atomic values.
Subtype: when the designer or user must create a new type that is
similar but not identical to an already defined type
Manager salesStaff
salesManager