0% found this document useful (0 votes)
11 views19 pages

Object-Oriented Database Concepts Explained

Uploaded by

Seladdin Yassin
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views19 pages

Object-Oriented Database Concepts Explained

Uploaded by

Seladdin Yassin
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Advanced Database System

Chapter one
Outlines
 Overview of O-O Concepts
 O-O Identity, Object Structure and Type Constructors
 Encapsulation of Operations, Methods and Persistence
 Type and Class Hierarchies and Inheritance
Object oriented concepts
Object
 It is a kind of idiom or metaphor that addresses the human psychology and the way
humans perceive the real world and think.
Object Oriented Databases (OODBS)
 It store data together with the appropriate methods for accessing it.
 It enables:
 Complex data types to be stored (e.g. CAD applications)
 A wide range of data types in the same database (e.g. multimedia applications)
 Easier to follow objects through time (e.g. "evolutionary applications")
Object oriented concepts
Applications of OODBS
 The first areas where OODBMS were widely used were:
 CAD(computer aid design)
 CAM(computer aid manufacturing)
 Now it is increasingly used in:
 Telecommunications
 Healthcare
 Finance
 Multimedia
 Text/document/quality management
Object oriented concepts
Data is formally represented as instances of one or more relations.
Attribute is a named column of a relation table, representing a “Property.”
Relation is a table:
Tuple is a row of the table, representing a “record.”
Object Identity
 OO database provides a unique identity to each independent object stored in the
database.
 This unique identity is implemented via a unique, system generated object identifier
(OID)
 The value of OID is not visible to the external user, but it is used:
 Internally by the system to identify each object uniquely and
 To create and manage inter object references
 An object retains its identity even if some or all of the values of variables or definitions
of methods change over time.
 It is a stronger notion of identity than in programming languages or data models not
based on object orientation.
Object Identity
 OID have two main properties:
 It is immutable: The OID of a particular object should not change
 Each OID can be used only once: Even if an object is removed from the
database its OID should not be assigned to another object.
Object Identity is represented by:
 Value – data value; e.g. primary key value used in relational systems.
 Name – supplied by user; used for variables in procedures.
 Built-in – identity built into data model or programming language.
No user-supplied identifier is required.
Is the form of identity used in object-oriented systems
Object Structure
 The state (current value) of a complex object may be constructed from other objects (or
other values) by using certain type constructors.
 Formal way of representing complex object is to view each object as a triple (i, c, v)
 i is a unique object identifier (the OID)
 c is a type constructor (an indication of how the object state is constructed)
 v is the object state (current value)
 This model of objects allows arbitrary nesting of the set, list, tuple and other
constructors.
Object Structure Cont.
Type Constructors
 The data model will typically include several type constructors.
 The three most basic constructors are:
 Atom
 Tuple
 Set
 Other commonly used constructors include list, bag and array.
The atom constructor
 It 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.
Object Structure Cont.
Example:
Encapsulation
 The concept of encapsulation is one of the main characteristics of OO languages and
systems.
 It is related to the concepts of abstract data types and information hiding in
programming language.
 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.
 The internal structure of the object is hidden and the object is accessible only through
a number of predefined operations
 Operations used to:
 Create (insert) or destroy (delete) objects
 Update object state
 Retrieve parts of the object state, etc…
Encapsulation Cont.
 The external users of the object are only made aware of the interface of the object type,
which defines the name and arguments (parameters) of each operation.
 Definition of the internal data structures of the object and implementation of the
operation that access these structures.
Signature: is the interface part of each operation.
Method: is implementation of the operation.
 it is invoked by sending a message to the object to execute the corresponding
method.
 For database applications, the requirement that all objects be completely encapsulated is
too stringent.
 So, it divides the structure of an object in to visible and hidden attributes.
Encapsulation Cont.
Visible attributes
 They are directly accessed for reading by external operators or high-lever query
languages.
Hidden attributes
 They are completely encapsulated and can be accessed only through predefined
operations.
Inheritance
 Object oriented database system permits the definition of new types based on other
predefined types which leads to type (class) hierarchy.
 Data and functions are organized in a hierarchy
 Objects inherit characteristics and functions of their ancestor objects
 Sharing of data within hierarchy scope supports code reusability
 A mechanism of reusability, the most powerful concept of OO programming
Inheritance
Inheritance
Example 2:
 Animals:A head and a body, feed
 Mammals:A head and a body, feed + Four legs, sit
 Fish:A head and a body, feed + swim
Inheritance
 Inheritance allows one class to define as a special case of more general class.
 These special classes are known as subclass, and the more general classes are known as
super classes.
 By default, a subclass inherits all the properties (both state and behavior) of its super
class, and it also defines its own unique properties.
 In addition, a subclass can redefine inherited methods.
 If class B is a subclass of class A, then if class B inherits the characteristics of class A,
every instance of B is automatically an instance of A. however the reverse is not true.
Inheritance
Type (class) Hierarchy
 It classifies entities into subclasses.
 Two types of hierarchy:
1. Specialization-Process of specifying subclasses of an entity set (superclass)
sharing some characteristics. Superclass is defined first followed by subclasses.
2. Generalization – Opposite of specialisation. Define first subclasses
o u !
n k Y
T h a

You might also like