SlideShare a Scribd company logo
1 of 22
Chapter 1
Concepts for Object Oriented
Databases
By: Melaku Y
Chapter Outline
1. Overview of O-O Concepts
2. O-O Identity, Object Structure and Type
Constructors
3. Encapsulation of Operations, Methods and
Persistence
4. Type and Class Hierarchies and Inheritance
2
Introduction
• Data model is used to describe the structure of the database
• Traditional Data Models:
 Hierarchical (1960)
 Network (since mid-60’s)
 Entity-relationship Model
 Relational (since 1970 and commercially since 1982)
• Object Oriented (OO) Data Models since mid-90’s
• Reasons for creation of Object Oriented Databases
 Need for more complex applications
• Give the designer to specify both the structure of complex objects
and the operations
 Increased use of object-oriented programming languages
• Difficult to integrate with traditional database
 Need for additional data modeling features 3
1.1 Overview of Object-Oriented Concepts(1)
• As commercial object DBMSs became available, the need for a
standard model and language was recognized.
• 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: A uniquely identifiable entity
 That contains both the attributes that describe the state of a ‘real
world’ object and the actions that are associated with it. (Simula
1960s)
• Object: has two components:
 state (value) and behavior (operations)
Similar to program variable in programming language, except that it
will typically have a complex data structure as well as specific
operations defined by the programmer 4
Overview of Object-Oriented Concepts (2)
• In OO databases,
 objects may have an object structure of arbitrary complexity in order to
contain all of the necessary information that describes the object.
• In contrast, in traditional database systems,
 information about a complex object is often scattered over many
relations or records, leading to loss of direct correspondence between
a real-world object and its database representation.
• Persistent vs transient object
 Transient object: exist only during program execution
 Persistent object: exist beyond program termination
Stored by OO databases permanently in secondary storage
 Allow the sharing objects among multiple programs and applications.
 What needed: indexing and concurrency(DBMS Features)
5
Overview of Object-Oriented Concepts (3)
• The internal structure of an object in OOPLs
 includes the specification of instance variables, which hold the
values that define the internal state of the object.
• An instance variable is similar to the concept of an attribute,
 except that instance variables may be encapsulated within the
object and thus are not necessarily visible to external users
• Some OO models insist that
 all operations a user can apply to an object must be predefined.
This forces a complete encapsulation of objects.
 Issues: users required to know attribute name to retrieve specific
objects and any simple retrieval requires a predefined operation
6
Overview of Object-Oriented Concepts (4)
• To encourage encapsulation, an operation is defined in two parts:
 signature or interface of the operation, specifies the operation
name and arguments (or parameters).
 method or body, specifies the implementation of the operation.
 Operations can be invoked by
 passing a message to an object, which includes the operation name
and the parameters.
 The object then executes the method for that operation.
 This encapsulation permits
 modification of the internal structure of an object, as well as
 the implementation of its operations, without the need to disturb
the external programs that invoke these operations
7
Overview of Object-Oriented Concepts (5)
• Type and Class hierarchies and Inheritance
 permits specification of new types or classes that inherit much of their
structure and/or operations from previously defined types or classes.
 this makes it easier to develop the data types of a system incrementally
and to reuse existing type definitions when creating new types of
objects.
 Operator overloading(operator polymorphism)
 refers to an operation’s ability to be applied to different types of objects
 in such a situation, an operation name may refer to several distinct
implementations, depending on the type of object it is applied to.
8
1.2 Object Identity, Object Structure, and Type
Constructors (1)
• 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(OID)
the main property of OID
immutable (should not change). this preserves the identity of the real-
world object being represented.
used only once, even if an object is removed from the database, its OID
should not be assigned to another object
Object may given one or more names meaningful to the user
identifies a single object within a database.
intended to act as ‘root’ objects that provide entry points into the
database. 9
Object Identity, Object Structure, and Type
Constructors (3)
• Type Constructors:
 In ODBs, a complex type may be constructed from other types by
nesting of type constructors.
• The three most basic constructors are:
 atom (basic built-in data types)
 tuple (compound or composite type)
• struct Name<FirstName: string, MiddleInitial: char, LastName:
string>
• struct CollegeDegree<Major: string, Degree: string, Year: date>
 collection (multivalued) => set, array, list, bag, dictionary
 The atom constructor is used to represent all basic atomic values
 integers, real numbers, character strings, Booleans, other
10
Object Identity, Object Structure, and Type
Constructors (4)
• Tuple constructor
 create structured values and objects of the form <a1:i1, a2:i2, … ,
an:in>
• Set constructor
 create objects or literals that are a set of distinct elements {i1, i2, … ,
in}, all of the same type
• Bag constructor
 Same as set but elements need not be distinct
• List constructor
 create an ordered list [i1, i2, … , in]
 Array constructor
 create a single-dimensional array of elements of the same type
 Dictionary constructor
 creates a collection of key-value pairs (K, V) 11
Object Identity, Object Structure, and Type
Constructors (5)
12
1.3 Encapsulation of Operations, Persistence of
Objects(1)
• 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
 In traditional database models and systems this concept was not
applied
 since it is customary to make the structure of database objects
visible to users and external programs
The relation and its attributes can be accessed using generic
operations.
 The concept of encapsulation means that
 Object contains both data structure and the set of operations used to
manipulate it.
13
1.3 Encapsulation of Operations,
Methods, and Persistence (2)
• The concept of information hiding means that
 external aspects of an object is separated from its internal details,
which are hidden from the outside world.
 The external users of the object are only made aware of the
interface (signature) of the operation
• Specifying Object Behavior via Class Operations (methods):
 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
14
Encapsulation of Operations, Methods, and
Persistence (4)
 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).
 An operation is typically applied to an object by using the
dot notation.
15
16
Encapsulation of Operations, Methods, and
Persistence (6)
• Specifying Object Persistence via Naming and Reachability:
 Transient objects
• exist in the executing program and disappear when program
terminates.
 Persistent objects
• stored in the database and persist after program termination.
• Mechanisms to make an object persistent
 Naming Mechanism:
• name can be given to an object via a specific statement or operation in the
program
• the named objects are used as entry points to the database through which
users and applications can start their database access
 Reachability Mechanism:
• Make the object reachable from some other 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.
17
Encapsulation of Operations, Methods, and
Persistence (6)
18
1.4 Type and Class Hierarchies and Inheritance (1)
• Type (class) Hierarchy
 A type is defined by
 assigning type name and defining attributes (instance variables) and
operations (methods).
has a type name and a list of visible (public) functions
• Specifications: TYPE_NAME: function, function, . . . , function
Example:
• PERSON: Name, Address, Birthdate, Age, SSN
• Subtype:
 When the designer or user must create a new type
 that is similar but not identical to an already defined type
 inherits all the functions of supertype
19
Type and Class Hierarchies and Inheritance (3)
• 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
20
Type and Class Hierarchies and Inheritance (4)
• Example (2):
 GEOMETRY_OBJECT: Shape, Area, ReferencePoint
 RECTANGLE subtype-of GEOMETRY_OBJECT: Width, Height
 TRIANGLE subtype-of GEOMETRY_OBJECT: Side1, Side2, Angle
 CIRCLE subtype-of GEOMETRY_OBJECT: Radius
21
Thank you
22

More Related Content

Similar to Concepts for Object Oriented Databases.ppt

OODBMS Concepts - National University of Singapore.pdf
OODBMS Concepts - National University of Singapore.pdfOODBMS Concepts - National University of Singapore.pdf
OODBMS Concepts - National University of Singapore.pdfssuserd5e338
 
Object oriented database concepts
Object oriented database conceptsObject oriented database concepts
Object oriented database conceptsTemesgenthanks
 
Object database standards, languages and design
Object database standards, languages and designObject database standards, languages and design
Object database standards, languages and designDabbal Singh Mahara
 
OOAD unit1 introduction to object orientation
 OOAD unit1 introduction to object orientation OOAD unit1 introduction to object orientation
OOAD unit1 introduction to object orientationDr Chetan Shelke
 
Introduction to Object Oriented databases
Introduction to Object Oriented databasesIntroduction to Object Oriented databases
Introduction to Object Oriented databasesDr. C.V. Suresh Babu
 
The Object Oriented Database System Manifesto
The Object Oriented Database System ManifestoThe Object Oriented Database System Manifesto
The Object Oriented Database System ManifestoBeat Signer
 
L1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdfL1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdfBhanuJatinSingh
 
introduction-to-dbms-unit-1.ppt
introduction-to-dbms-unit-1.pptintroduction-to-dbms-unit-1.ppt
introduction-to-dbms-unit-1.pptrekhasai2468
 
Adbms 12 encapsulation and its benefits
Adbms 12 encapsulation and its benefitsAdbms 12 encapsulation and its benefits
Adbms 12 encapsulation and its benefitsVaibhav Khanna
 
Chapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdfChapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdfTamiratDejene1
 
Analyzing a system and specifying the requirements
Analyzing a system and specifying the requirementsAnalyzing a system and specifying the requirements
Analyzing a system and specifying the requirementsvikramgopale2
 
DatabaseManagementSystem.pptx
DatabaseManagementSystem.pptxDatabaseManagementSystem.pptx
DatabaseManagementSystem.pptxuwmctesting
 
Design pattern and their application
Design pattern and their applicationDesign pattern and their application
Design pattern and their applicationHiệp Tiến
 

Similar to Concepts for Object Oriented Databases.ppt (20)

OODBMS Concepts - National University of Singapore.pdf
OODBMS Concepts - National University of Singapore.pdfOODBMS Concepts - National University of Singapore.pdf
OODBMS Concepts - National University of Singapore.pdf
 
Object oriented database concepts
Object oriented database conceptsObject oriented database concepts
Object oriented database concepts
 
Object database standards, languages and design
Object database standards, languages and designObject database standards, languages and design
Object database standards, languages and design
 
OOAD unit1 introduction to object orientation
 OOAD unit1 introduction to object orientation OOAD unit1 introduction to object orientation
OOAD unit1 introduction to object orientation
 
Principles of OOPs.pptx
Principles of OOPs.pptxPrinciples of OOPs.pptx
Principles of OOPs.pptx
 
Introduction to Object Oriented databases
Introduction to Object Oriented databasesIntroduction to Object Oriented databases
Introduction to Object Oriented databases
 
Ooad ch 2
Ooad ch 2Ooad ch 2
Ooad ch 2
 
Ordbms
OrdbmsOrdbms
Ordbms
 
The Object Oriented Database System Manifesto
The Object Oriented Database System ManifestoThe Object Oriented Database System Manifesto
The Object Oriented Database System Manifesto
 
L1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdfL1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdf
 
OOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptxOOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptx
 
introduction-to-dbms-unit-1.ppt
introduction-to-dbms-unit-1.pptintroduction-to-dbms-unit-1.ppt
introduction-to-dbms-unit-1.ppt
 
Adbms 12 encapsulation and its benefits
Adbms 12 encapsulation and its benefitsAdbms 12 encapsulation and its benefits
Adbms 12 encapsulation and its benefits
 
Ooad ch 1_2
Ooad ch 1_2Ooad ch 1_2
Ooad ch 1_2
 
Unit 1 OOSE
Unit 1 OOSE Unit 1 OOSE
Unit 1 OOSE
 
Chapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdfChapter – 2 Data Models.pdf
Chapter – 2 Data Models.pdf
 
Introduction to odbms
Introduction to odbmsIntroduction to odbms
Introduction to odbms
 
Analyzing a system and specifying the requirements
Analyzing a system and specifying the requirementsAnalyzing a system and specifying the requirements
Analyzing a system and specifying the requirements
 
DatabaseManagementSystem.pptx
DatabaseManagementSystem.pptxDatabaseManagementSystem.pptx
DatabaseManagementSystem.pptx
 
Design pattern and their application
Design pattern and their applicationDesign pattern and their application
Design pattern and their application
 

Recently uploaded

What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 

Recently uploaded (20)

Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 

Concepts for Object Oriented Databases.ppt

  • 1. Chapter 1 Concepts for Object Oriented Databases By: Melaku Y
  • 2. Chapter Outline 1. Overview of O-O Concepts 2. O-O Identity, Object Structure and Type Constructors 3. Encapsulation of Operations, Methods and Persistence 4. Type and Class Hierarchies and Inheritance 2
  • 3. Introduction • Data model is used to describe the structure of the database • Traditional Data Models:  Hierarchical (1960)  Network (since mid-60’s)  Entity-relationship Model  Relational (since 1970 and commercially since 1982) • Object Oriented (OO) Data Models since mid-90’s • Reasons for creation of Object Oriented Databases  Need for more complex applications • Give the designer to specify both the structure of complex objects and the operations  Increased use of object-oriented programming languages • Difficult to integrate with traditional database  Need for additional data modeling features 3
  • 4. 1.1 Overview of Object-Oriented Concepts(1) • As commercial object DBMSs became available, the need for a standard model and language was recognized. • 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: A uniquely identifiable entity  That contains both the attributes that describe the state of a ‘real world’ object and the actions that are associated with it. (Simula 1960s) • Object: has two components:  state (value) and behavior (operations) Similar to program variable in programming language, except that it will typically have a complex data structure as well as specific operations defined by the programmer 4
  • 5. Overview of Object-Oriented Concepts (2) • In OO databases,  objects may have an object structure of arbitrary complexity in order to contain all of the necessary information that describes the object. • In contrast, in traditional database systems,  information about a complex object is often scattered over many relations or records, leading to loss of direct correspondence between a real-world object and its database representation. • Persistent vs transient object  Transient object: exist only during program execution  Persistent object: exist beyond program termination Stored by OO databases permanently in secondary storage  Allow the sharing objects among multiple programs and applications.  What needed: indexing and concurrency(DBMS Features) 5
  • 6. Overview of Object-Oriented Concepts (3) • The internal structure of an object in OOPLs  includes the specification of instance variables, which hold the values that define the internal state of the object. • An instance variable is similar to the concept of an attribute,  except that instance variables may be encapsulated within the object and thus are not necessarily visible to external users • Some OO models insist that  all operations a user can apply to an object must be predefined. This forces a complete encapsulation of objects.  Issues: users required to know attribute name to retrieve specific objects and any simple retrieval requires a predefined operation 6
  • 7. Overview of Object-Oriented Concepts (4) • To encourage encapsulation, an operation is defined in two parts:  signature or interface of the operation, specifies the operation name and arguments (or parameters).  method or body, specifies the implementation of the operation.  Operations can be invoked by  passing a message to an object, which includes the operation name and the parameters.  The object then executes the method for that operation.  This encapsulation permits  modification of the internal structure of an object, as well as  the implementation of its operations, without the need to disturb the external programs that invoke these operations 7
  • 8. Overview of Object-Oriented Concepts (5) • Type and Class hierarchies and Inheritance  permits specification of new types or classes that inherit much of their structure and/or operations from previously defined types or classes.  this makes it easier to develop the data types of a system incrementally and to reuse existing type definitions when creating new types of objects.  Operator overloading(operator polymorphism)  refers to an operation’s ability to be applied to different types of objects  in such a situation, an operation name may refer to several distinct implementations, depending on the type of object it is applied to. 8
  • 9. 1.2 Object Identity, Object Structure, and Type Constructors (1) • 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(OID) the main property of OID immutable (should not change). this preserves the identity of the real- world object being represented. used only once, even if an object is removed from the database, its OID should not be assigned to another object Object may given one or more names meaningful to the user identifies a single object within a database. intended to act as ‘root’ objects that provide entry points into the database. 9
  • 10. Object Identity, Object Structure, and Type Constructors (3) • Type Constructors:  In ODBs, a complex type may be constructed from other types by nesting of type constructors. • The three most basic constructors are:  atom (basic built-in data types)  tuple (compound or composite type) • struct Name<FirstName: string, MiddleInitial: char, LastName: string> • struct CollegeDegree<Major: string, Degree: string, Year: date>  collection (multivalued) => set, array, list, bag, dictionary  The atom constructor is used to represent all basic atomic values  integers, real numbers, character strings, Booleans, other 10
  • 11. Object Identity, Object Structure, and Type Constructors (4) • Tuple constructor  create structured values and objects of the form <a1:i1, a2:i2, … , an:in> • Set constructor  create objects or literals that are a set of distinct elements {i1, i2, … , in}, all of the same type • Bag constructor  Same as set but elements need not be distinct • List constructor  create an ordered list [i1, i2, … , in]  Array constructor  create a single-dimensional array of elements of the same type  Dictionary constructor  creates a collection of key-value pairs (K, V) 11
  • 12. Object Identity, Object Structure, and Type Constructors (5) 12
  • 13. 1.3 Encapsulation of Operations, Persistence of Objects(1) • 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  In traditional database models and systems this concept was not applied  since it is customary to make the structure of database objects visible to users and external programs The relation and its attributes can be accessed using generic operations.  The concept of encapsulation means that  Object contains both data structure and the set of operations used to manipulate it. 13
  • 14. 1.3 Encapsulation of Operations, Methods, and Persistence (2) • The concept of information hiding means that  external aspects of an object is separated from its internal details, which are hidden from the outside world.  The external users of the object are only made aware of the interface (signature) of the operation • Specifying Object Behavior via Class Operations (methods):  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 14
  • 15. Encapsulation of Operations, Methods, and Persistence (4)  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).  An operation is typically applied to an object by using the dot notation. 15
  • 16. 16
  • 17. Encapsulation of Operations, Methods, and Persistence (6) • Specifying Object Persistence via Naming and Reachability:  Transient objects • exist in the executing program and disappear when program terminates.  Persistent objects • stored in the database and persist after program termination. • Mechanisms to make an object persistent  Naming Mechanism: • name can be given to an object via a specific statement or operation in the program • the named objects are used as entry points to the database through which users and applications can start their database access  Reachability Mechanism: • Make the object reachable from some other 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. 17
  • 18. Encapsulation of Operations, Methods, and Persistence (6) 18
  • 19. 1.4 Type and Class Hierarchies and Inheritance (1) • Type (class) Hierarchy  A type is defined by  assigning type name and defining attributes (instance variables) and operations (methods). has a type name and a list of visible (public) functions • Specifications: TYPE_NAME: function, function, . . . , function Example: • PERSON: Name, Address, Birthdate, Age, SSN • Subtype:  When the designer or user must create a new type  that is similar but not identical to an already defined type  inherits all the functions of supertype 19
  • 20. Type and Class Hierarchies and Inheritance (3) • 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 20
  • 21. Type and Class Hierarchies and Inheritance (4) • Example (2):  GEOMETRY_OBJECT: Shape, Area, ReferencePoint  RECTANGLE subtype-of GEOMETRY_OBJECT: Width, Height  TRIANGLE subtype-of GEOMETRY_OBJECT: Side1, Side2, Angle  CIRCLE subtype-of GEOMETRY_OBJECT: Radius 21