SlideShare a Scribd company logo
1 of 32
Advanced Database Systems
Object Oriented Database
MIT 302
Reference: Object-Oriented Database {Concepts, Examples, Pros and Cons} (phoenixnap.com), et al
Objective
• To examine and learn the concepts of object-oriented
database design
• To understand the need to transition to object-oriented
database from the relational one
• To prepare for designing an object-oriented database
system using software tools, ei, LUCITCHART, UML 2.0 or
other latest version, Postgresql, or Mysql
Background
• Object Oriented Databases are a result of the advancement of
database systems from relational database management system
RDBMS
• Instead of dealing with entities, objects are dealt with
• It is the industry trend nowadays, though, majority of the world is
still on relational database
• OODB harmoniously dances with OO Programming languages, ie.
Java and c++, among others
• Postgresql is ideal sql
Object Database (Object-Oriented Database {Concepts, Examples, Pros and Cons} (phoenixnap.com)
• An object database is managed by an object-
oriented database management system (OODBMS). The database
combines object-oriented programming concepts with relational
database principles.
• Objects are the basic building block and an instance of a class, where
the type is either built-in or user-defined.
• Classes provide a schema or blueprint for objects, defining the
behavior.
• Methods determine the behavior of a class.
• Pointers help access elements of an object database and establish
relations between objects.
Source: (Object-Oriented Database {Concepts, Examples, Pros and Cons} (phoenixnap.com)
Object Oriented DB (Object-Oriented Database {Concepts, Examples, Pros and Cons} (phoenixnap.com)
OODB (Object-Oriented Database {Concepts, Examples, Pros and Cons} (phoenixnap.com)
• The main characteristic of objects in OODBMS is the
possibility of user-constructed types. An object
created in a project or application saves into a
database as is.
• Object-oriented databases directly deal with data as
complete objects. All the information comes in one
instantly available object package instead of multiple
tables.
Object classes
Similar objects (have the same attributes, respond to the same messages) are
grouped into a class.
The attributes and associated methods are defined once for the class.
Al objects in a class have the same:
variable types
message interface
methods
They may differ in the values assigned to variables
Classes are analogous to entity sets in the ER model.
Example: all branch objects would be described by a single Branch class.
9
BRANCH
Attributes
bno
street
city
area
…
Methods
print
update_tel_no
….
bno=B5
street=12 Deer St
city=Sidcup
area=London
...
bno=B7
street=16 Dever St
city=Dyce
area=Aberden
...
bno=B3
street=154 Main St
city=Partick
area=Glasgow
...
10
Class attributes describes the general characteristics of the class,
such as totals or averages( ex: total no of branches)
Class methods are used to change or query the state of class attributes
There are special class methods to create new instances of the class:
new --constructor
destructor
In the following example, employment-length is a derived attribute.
For strict encapsulation, methods to read and set other variables are
also needed
class employee {
/*Variables */
string name;
string address;
date start-date;
int salary;
/* Messages */
int annual-salary;
string get-name;
string get-address;
int set-address ( string new-address)
int employment-length;
};
Object-Oriented Programming Concepts
• Polymorphism
• Inheritance
• Encapsulation
• Abstraction
These four attributes describe the critical characteristics of object-oriented management systems
Polymorphism
• is an object-oriented programming concept that refers
to the ability of a variable, function or object to take on
multiple forms. A language that features polymorphism
allows developers to program in the general rather than
program in the specific. www.techopedia.com/definition/28106/polymorphism-
general-programming
Inheritance
• is the procedure in which one class inherits the attributes
and methods of another class. The class whose properties
and methods are inherited is known as the Parent class.
And the class that inherits the properties from the parent
class is the Child class. www.analyticsvidhya.com/blog/2020/10/inheritance-object-
oriented-programmi…
Source: Wikipedia.org
Inheritance allows one class (subclass) to be defined as a special
case of a more general class (superclass).
The process of forming a superclass is referred to as generalization.
The process of forming a subclass is referred to as specialization.
By default, a subclass inherits all the properties of its superclass(es)
and, additionally, defines its own unique properties.
A subclass can redefine inherited methods.
All instances of the subclass are also instances of the superclass.
Principle of substitutability: we can use an instance of the subclass
whenever a method or a construct expects an instance
of the superclass..
The relation between the subclass and superclass: A KIND OF (AKO)
The relation between an instance and its class: IS-A.
Examples:
Manager is AKO Staff.
Susan Deer IS-A Manager.
Inheritance:
1. Single inheritance: the subclass inherits from no more than one
superclass
2. Multiple inheritance: the subclass inherits from more than one
superclass ===> conflicts!
17
Staff
Person
Manager Sales_Staff
Manager Sales_Staff
Sales_Manager
Single
inheritance
Multiple
inheritance
Repeated inheritance: a special case of multiple inheritance
superclasses inherit from a common superclass
The inheritance mechanism must ensure that the subclass does
not inherits properties twice.
Staff
Manager Sales_Staff
Sales_Manager
4. Selective inheritance:allows a subclass to inherit a limited
number of properties from the superclass.
Object Identity
Each object is assigned an Object Identifier (OID) when it is
created that is:
system generated
unique to that object
invariant
independent of the values of its attributes
inivisible to the user
Other concepts:
overriding (+ overloading)
polymorphism & dynamic binding
complex objects
persistence
OODBMS
Hierarchical Data Model
Network Data Model
Relational Data Model
ER Data Model
Semantic Data Model
Object-Relational Data Model Object Oriented Data Model
1960 -
1970
First generation DBMS
1970 - 1980 Second generation DBMS
E. Codd, 1970
IMS
Chen, 1976
Third generation DBMS
Hammer, McLeod,
1981
1980-2000
Encapsulation
• is one of the core concepts in object-oriented
programming. It describes the bundling of data and
methods operating on this data into one unit. It is often
used to implement an information-hiding mechanism.
Source: Object-Oriented Database {Concepts,
Examples, Pros and Cons} (phoenixnap.com)
Abstraction (stackify.com/oop-concept-abstraction/)
• key concepts of object-oriented programming (OOP) languages
• Its main goal is to handle complexity by hiding unnecessary
details from the user
• That enables the user to implement more complex logic on top
of the provided abstraction without understanding or even
thinking about all the hidden complexity
Example of OQL query
The following is a sample query
“what are the names of the black product?”
Select distinct p.name
From products p
Where p.color = “black”
Valid in both SQL and OQL, but results are different.
Result of the query (SQL)
Product no Name Color
P1 Ford Mustang Black
P2 Toyota Celica Green
P3 Mercedes SLK Black
- The statement queries a relational database.
=> Returns a table with rows.
Name
Ford Mustang
Mercedes SLK
Result
Original table
Comparison
 Queries look very similar in SQL and OQL,
sometimes they are the same
 In fact, the results they give are very different
Query returns:
OQL SQL
Object
Collection of objects
Tuple
Table
SQL3 “Object-oriented SQL”
• Foundation for several OO database management systems –
ORACLE8, DB2, etc
• New features – “relational” & “Object oriented”
• Relational Features – new data types, new predicates,
enhanced semantics, additional security and an active
database
• Object Oriented Features – support for functions and
procedures
User defined Data Types
Creating a “row type”
Example:
create row type AddressType(
street char(50),
city char(20));
create row type StarType(
name char(30),
address AddressType);
Creating Data Types (contd.)
Creating “Table”
create table Address of type AddressType;
create table MovieStar of type StarType;
Instances of Row types are tuples in tables
Sample Query
Find the names and street addresses of those MovieStars
who stay in the city “Columbus”:
select MovieStar.name,
MovieStar.address.street
from MovieStar
where MovieStar.address.city = “Columbus”;
Using Postgresql has similar commands with Mysql
Requirement for this Trimester
1. This requirement shall be undertaken by INDIVIDUAL or by GROUP OF 2
2. Email me if you intend to do it alone or
3. Email me the name of your GROUP and MEMBERS. Please, indicate who is the
Project Manager
4. Immediately, choose a company, and send the profile of it
5. Your chosen company shall be the subject for your DATABASE DESIGN
6. You may choose whether your design shall be RELATIONAL DATABASE or OBJECT-
ORIENTED DATABASE
7. If it is Relational, you may use UML 2.0 thru LUCIDCHART and MYSQL
8. If it is Object-Oriented, you use UML 2.0 thru LUCIDCHART and Postgresql
9. By accomplishing item 1-6, you earned 10-point QUIZ

More Related Content

Similar to MIT302 Lesson 2_Advanced Database Systems.pptx

Object-Oriented Database Model For Effective Mining Of Advanced Engineering M...
Object-Oriented Database Model For Effective Mining Of Advanced Engineering M...Object-Oriented Database Model For Effective Mining Of Advanced Engineering M...
Object-Oriented Database Model For Effective Mining Of Advanced Engineering M...cscpconf
 
Chapter 1 - Concepts for Object Databases.ppt
Chapter 1 - Concepts for Object Databases.pptChapter 1 - Concepts for Object Databases.ppt
Chapter 1 - Concepts for Object Databases.pptShemse Shukre
 
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
 
implementing oop_concept
 implementing oop_concept implementing oop_concept
implementing oop_conceptAmit Gupta
 
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
 
Adbms 14 oodbms concepts for managing objects
Adbms 14 oodbms concepts for managing objectsAdbms 14 oodbms concepts for managing objects
Adbms 14 oodbms concepts for managing objectsVaibhav Khanna
 
The Object Oriented Database System Manifesto
The Object Oriented Database System ManifestoThe Object Oriented Database System Manifesto
The Object Oriented Database System ManifestoBeat Signer
 
Object oriented database concepts
Object oriented database conceptsObject oriented database concepts
Object oriented database conceptsTemesgenthanks
 
Introduction to Object Oriented databases
Introduction to Object Oriented databasesIntroduction to Object Oriented databases
Introduction to Object Oriented databasesDr. C.V. Suresh Babu
 
Interview preparation for programming.pptx
Interview preparation for programming.pptxInterview preparation for programming.pptx
Interview preparation for programming.pptxBilalHussainShah5
 
ADBMS Object and Object Relational Databases
ADBMS  Object  and Object Relational Databases ADBMS  Object  and Object Relational Databases
ADBMS Object and Object Relational Databases Jayanthi Kannan MK
 
8 oo approach&uml-23_feb
8 oo approach&uml-23_feb8 oo approach&uml-23_feb
8 oo approach&uml-23_febRaj Shah
 

Similar to MIT302 Lesson 2_Advanced Database Systems.pptx (20)

Object-Oriented Database Model For Effective Mining Of Advanced Engineering M...
Object-Oriented Database Model For Effective Mining Of Advanced Engineering M...Object-Oriented Database Model For Effective Mining Of Advanced Engineering M...
Object-Oriented Database Model For Effective Mining Of Advanced Engineering M...
 
Ooad ch 2
Ooad ch 2Ooad ch 2
Ooad ch 2
 
Chapter 1 - Concepts for Object Databases.ppt
Chapter 1 - Concepts for Object Databases.pptChapter 1 - Concepts for Object Databases.ppt
Chapter 1 - Concepts for Object Databases.ppt
 
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
 
OOP intro.ppt
OOP intro.pptOOP intro.ppt
OOP intro.ppt
 
implementing oop_concept
 implementing oop_concept implementing oop_concept
implementing oop_concept
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
OOAD unit1 introduction to object orientation
 OOAD unit1 introduction to object orientation OOAD unit1 introduction to object orientation
OOAD unit1 introduction to object orientation
 
Adbms 14 oodbms concepts for managing objects
Adbms 14 oodbms concepts for managing objectsAdbms 14 oodbms concepts for managing objects
Adbms 14 oodbms concepts for managing objects
 
215 oodb
215 oodb215 oodb
215 oodb
 
The Object Oriented Database System Manifesto
The Object Oriented Database System ManifestoThe Object Oriented Database System Manifesto
The Object Oriented Database System Manifesto
 
Object oriented database concepts
Object oriented database conceptsObject oriented database concepts
Object oriented database concepts
 
Introduction to Object Oriented databases
Introduction to Object Oriented databasesIntroduction to Object Oriented databases
Introduction to Object Oriented databases
 
Ordbms
OrdbmsOrdbms
Ordbms
 
Oodb
OodbOodb
Oodb
 
Introduction to odbms
Introduction to odbmsIntroduction to odbms
Introduction to odbms
 
Interview preparation for programming.pptx
Interview preparation for programming.pptxInterview preparation for programming.pptx
Interview preparation for programming.pptx
 
ADBMS Object and Object Relational Databases
ADBMS  Object  and Object Relational Databases ADBMS  Object  and Object Relational Databases
ADBMS Object and Object Relational Databases
 
ppt_ooad.pdf
ppt_ooad.pdfppt_ooad.pdf
ppt_ooad.pdf
 
8 oo approach&uml-23_feb
8 oo approach&uml-23_feb8 oo approach&uml-23_feb
8 oo approach&uml-23_feb
 

Recently uploaded

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 

Recently uploaded (20)

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 

MIT302 Lesson 2_Advanced Database Systems.pptx

  • 1. Advanced Database Systems Object Oriented Database MIT 302 Reference: Object-Oriented Database {Concepts, Examples, Pros and Cons} (phoenixnap.com), et al
  • 2. Objective • To examine and learn the concepts of object-oriented database design • To understand the need to transition to object-oriented database from the relational one • To prepare for designing an object-oriented database system using software tools, ei, LUCITCHART, UML 2.0 or other latest version, Postgresql, or Mysql
  • 3. Background • Object Oriented Databases are a result of the advancement of database systems from relational database management system RDBMS • Instead of dealing with entities, objects are dealt with • It is the industry trend nowadays, though, majority of the world is still on relational database • OODB harmoniously dances with OO Programming languages, ie. Java and c++, among others • Postgresql is ideal sql
  • 4. Object Database (Object-Oriented Database {Concepts, Examples, Pros and Cons} (phoenixnap.com) • An object database is managed by an object- oriented database management system (OODBMS). The database combines object-oriented programming concepts with relational database principles. • Objects are the basic building block and an instance of a class, where the type is either built-in or user-defined. • Classes provide a schema or blueprint for objects, defining the behavior. • Methods determine the behavior of a class. • Pointers help access elements of an object database and establish relations between objects.
  • 5. Source: (Object-Oriented Database {Concepts, Examples, Pros and Cons} (phoenixnap.com)
  • 6. Object Oriented DB (Object-Oriented Database {Concepts, Examples, Pros and Cons} (phoenixnap.com)
  • 7. OODB (Object-Oriented Database {Concepts, Examples, Pros and Cons} (phoenixnap.com) • The main characteristic of objects in OODBMS is the possibility of user-constructed types. An object created in a project or application saves into a database as is. • Object-oriented databases directly deal with data as complete objects. All the information comes in one instantly available object package instead of multiple tables.
  • 8. Object classes Similar objects (have the same attributes, respond to the same messages) are grouped into a class. The attributes and associated methods are defined once for the class. Al objects in a class have the same: variable types message interface methods They may differ in the values assigned to variables Classes are analogous to entity sets in the ER model. Example: all branch objects would be described by a single Branch class.
  • 10. 10 Class attributes describes the general characteristics of the class, such as totals or averages( ex: total no of branches) Class methods are used to change or query the state of class attributes There are special class methods to create new instances of the class: new --constructor destructor In the following example, employment-length is a derived attribute. For strict encapsulation, methods to read and set other variables are also needed
  • 11. class employee { /*Variables */ string name; string address; date start-date; int salary; /* Messages */ int annual-salary; string get-name; string get-address; int set-address ( string new-address) int employment-length; };
  • 12. Object-Oriented Programming Concepts • Polymorphism • Inheritance • Encapsulation • Abstraction These four attributes describe the critical characteristics of object-oriented management systems
  • 13. Polymorphism • is an object-oriented programming concept that refers to the ability of a variable, function or object to take on multiple forms. A language that features polymorphism allows developers to program in the general rather than program in the specific. www.techopedia.com/definition/28106/polymorphism- general-programming
  • 14. Inheritance • is the procedure in which one class inherits the attributes and methods of another class. The class whose properties and methods are inherited is known as the Parent class. And the class that inherits the properties from the parent class is the Child class. www.analyticsvidhya.com/blog/2020/10/inheritance-object- oriented-programmi… Source: Wikipedia.org
  • 15. Inheritance allows one class (subclass) to be defined as a special case of a more general class (superclass). The process of forming a superclass is referred to as generalization. The process of forming a subclass is referred to as specialization. By default, a subclass inherits all the properties of its superclass(es) and, additionally, defines its own unique properties. A subclass can redefine inherited methods. All instances of the subclass are also instances of the superclass. Principle of substitutability: we can use an instance of the subclass whenever a method or a construct expects an instance of the superclass..
  • 16. The relation between the subclass and superclass: A KIND OF (AKO) The relation between an instance and its class: IS-A. Examples: Manager is AKO Staff. Susan Deer IS-A Manager. Inheritance: 1. Single inheritance: the subclass inherits from no more than one superclass 2. Multiple inheritance: the subclass inherits from more than one superclass ===> conflicts!
  • 18. Repeated inheritance: a special case of multiple inheritance superclasses inherit from a common superclass The inheritance mechanism must ensure that the subclass does not inherits properties twice. Staff Manager Sales_Staff Sales_Manager 4. Selective inheritance:allows a subclass to inherit a limited number of properties from the superclass.
  • 19. Object Identity Each object is assigned an Object Identifier (OID) when it is created that is: system generated unique to that object invariant independent of the values of its attributes inivisible to the user Other concepts: overriding (+ overloading) polymorphism & dynamic binding complex objects persistence
  • 20.
  • 21. OODBMS Hierarchical Data Model Network Data Model Relational Data Model ER Data Model Semantic Data Model Object-Relational Data Model Object Oriented Data Model 1960 - 1970 First generation DBMS 1970 - 1980 Second generation DBMS E. Codd, 1970 IMS Chen, 1976 Third generation DBMS Hammer, McLeod, 1981 1980-2000
  • 22. Encapsulation • is one of the core concepts in object-oriented programming. It describes the bundling of data and methods operating on this data into one unit. It is often used to implement an information-hiding mechanism. Source: Object-Oriented Database {Concepts, Examples, Pros and Cons} (phoenixnap.com)
  • 23. Abstraction (stackify.com/oop-concept-abstraction/) • key concepts of object-oriented programming (OOP) languages • Its main goal is to handle complexity by hiding unnecessary details from the user • That enables the user to implement more complex logic on top of the provided abstraction without understanding or even thinking about all the hidden complexity
  • 24. Example of OQL query The following is a sample query “what are the names of the black product?” Select distinct p.name From products p Where p.color = “black” Valid in both SQL and OQL, but results are different.
  • 25. Result of the query (SQL) Product no Name Color P1 Ford Mustang Black P2 Toyota Celica Green P3 Mercedes SLK Black - The statement queries a relational database. => Returns a table with rows. Name Ford Mustang Mercedes SLK Result Original table
  • 26. Comparison  Queries look very similar in SQL and OQL, sometimes they are the same  In fact, the results they give are very different Query returns: OQL SQL Object Collection of objects Tuple Table
  • 27. SQL3 “Object-oriented SQL” • Foundation for several OO database management systems – ORACLE8, DB2, etc • New features – “relational” & “Object oriented” • Relational Features – new data types, new predicates, enhanced semantics, additional security and an active database • Object Oriented Features – support for functions and procedures
  • 28. User defined Data Types Creating a “row type” Example: create row type AddressType( street char(50), city char(20)); create row type StarType( name char(30), address AddressType);
  • 29. Creating Data Types (contd.) Creating “Table” create table Address of type AddressType; create table MovieStar of type StarType; Instances of Row types are tuples in tables
  • 30. Sample Query Find the names and street addresses of those MovieStars who stay in the city “Columbus”: select MovieStar.name, MovieStar.address.street from MovieStar where MovieStar.address.city = “Columbus”;
  • 31. Using Postgresql has similar commands with Mysql
  • 32. Requirement for this Trimester 1. This requirement shall be undertaken by INDIVIDUAL or by GROUP OF 2 2. Email me if you intend to do it alone or 3. Email me the name of your GROUP and MEMBERS. Please, indicate who is the Project Manager 4. Immediately, choose a company, and send the profile of it 5. Your chosen company shall be the subject for your DATABASE DESIGN 6. You may choose whether your design shall be RELATIONAL DATABASE or OBJECT- ORIENTED DATABASE 7. If it is Relational, you may use UML 2.0 thru LUCIDCHART and MYSQL 8. If it is Object-Oriented, you use UML 2.0 thru LUCIDCHART and Postgresql 9. By accomplishing item 1-6, you earned 10-point QUIZ