Chapter 1 Odbms Concepts
Chapter 1 Odbms Concepts
Chapter one:
Object Oriented
Database Concept
Prepared by:
Misganaw Abeje
University of Gondar
College Of Informatics
Department of computer science
[email protected]
Outline
BY: MA
Overview of Database and data model
BY: MA
Cont…
BY: MA
Object-Orientation Concepts
Class: is a design or a blue print of any entity, its
Collection of objects is called class.
Object: an instance of a class which has a physical
existence or a real-world entity.
Abstraction: Hiding internal details and showing functionality, only
shows relevant data.
Encapsulation: Binding (or wrapping) code and data together into
a single unit are known as encapsulation.
Polymorphism: If one task is performed in different ways, by using
the methods overloading and overriding.
Inheritance: When one object acquires all the properties and
behaviors of a parent object, it is known as inheritance. It provides
BY: MA code reusability. It is used to achieve runtime polymorphism.
Why Object-Oriented Databases?
BY: MA
Type Constructors
BY: MA
Formal definition:
1. Every atomic value in A is an object.
2. If a1, ..., an are attribute names in N, and Example:
O1, ..., On are objects, then T = [a1:O1, ..., (i1, atom, 'John')
an:On] is also an object, and T.ai retrieves the (i2, atom, 30)
value Oi. (i3, atom, 'Mary')
3. If O1, ..., On are objects, then S = {O1, ..., On} (i4, atom, 'Mark')
(i5, atom 'Vicki')
is an abject.
(i6, tuple, [Name:i1, Age:
Example1: {[Name:John, Age: 30], (i7, set, {i4, i5})
[Name:Mary, Friends:{Mark, Vicki}]} (i8, tuple, [Name:i3, Frien
An object is defined by a triple (OID, type (i9, set, {i6, i8})
constructor, state) where OID is the unique
object identifier, type constructor is its type
(such as atom, tuple, set, list, array, bag, etc.)
BY: MA
Object Identity, Object Structure, and
Type Constructors
Example 1
One possible relational database state
corresponding to COMPANY schema
BY: MA
Example1:cont…
BY: MA
Example1:cont…
BY: MA
Object Identity, Object Structure, and
Type Constructors
Example2(contd.)
We use i1, i2, i3, . . . to stand for unique system-
generated object identifiers. Consider the following
objects:
o1 = (i1, atom, ‘Houston’)
o2 = (i2, atom, ‘Bellaire’)
o3 = (i3, atom, ‘Sugarland’)
o4 = (i4, atom, 5)
o5 = (i5, atom, ‘Research’)
o6 = (i6, atom, ‘1988-05-22’)
BY: MA o = (i , set, {i1, i2, i3})
Object Identity, Object Structure, and
Type Constructors
Example 1(contd.)
o8 = (i8, tuple, <dname:i5, dnumber:i4, mgr:i9,
locations:i7, employees:i10, projects:i11>)
o9 = (i9, tuple, <manager: i12, manager_start_date:i6>)
o10 = (i10, set, {i12, i13, i14})
o11 = (i11, set {i15, i16, i17})
o12 = (i12, tuple, <fname:i18, minit:i19, lname:i20,
ssn:i21, . . ., salary:i26, supervisor:i27, dept:i8>)
...
BY: MA
Object Identity, Object Structure, and
Type Constructors
Example 1 (contd.)
– The first six objects listed in this example
represent atomic values.
– Object seven is a set-valued object that
represents the set of locations for department
5; the set refers to the atomic objects with
values {‘Houston’, ‘Bellaire’, ‘Sugarland’}.
– Object 8 is a tuple-valued object that
represents department 5 itself, and has the
attributes DNAME, DNUMBER, MGR,
BY: MA
LOCATIONS, and so on.
Object Identity, Object Structure, and
Type Constructors
BY: MA
Object Structure and Type
Constructors
BY: MA
Persistence of Objects
BY: MA
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.
For example: The DEPARTMENT object is structured object.
– define type DEPARTMENT
– tuple ( Dname: string;
– Dnumber: integer;
– Mgr: tuple ( Manager: EMPLOYEE;
– Start_date: DATE; );
– Locations: set(string);
– Employees: set(EMPLOYEE);
BY: MA
THANK YOU !