SlideShare a Scribd company logo
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
 
Ooad ch 2
Ooad ch 2Ooad ch 2
Ooad ch 2
anujabeatrice2
 
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
Shemse 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 requirements
vikramgopale2
 
OOP intro.ppt
OOP intro.pptOOP intro.ppt
OOP intro.ppt
NoreenNyauchiSarai1
 
implementing oop_concept
 implementing oop_concept implementing oop_concept
implementing oop_concept
Amit Gupta
 
Object oriented programming
Object oriented programmingObject 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
Dr 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 objects
Vaibhav Khanna
 
215 oodb
215 oodb215 oodb
215 oodb
trhtom90
 
The Object Oriented Database System Manifesto
The Object Oriented Database System ManifestoThe Object Oriented Database System Manifesto
The Object Oriented Database System Manifesto
Beat Signer
 
Object oriented database concepts
Object oriented database conceptsObject oriented database concepts
Object oriented database concepts
Temesgenthanks
 
Introduction to Object Oriented databases
Introduction to Object Oriented databasesIntroduction to Object Oriented databases
Introduction to Object Oriented databases
Dr. C.V. Suresh Babu
 
Ordbms
OrdbmsOrdbms
Oodb
OodbOodb
Introduction to odbms
Introduction to odbmsIntroduction to odbms
Introduction to odbms
ajay pashankar
 
Interview preparation for programming.pptx
Interview preparation for programming.pptxInterview preparation for programming.pptx
Interview preparation for programming.pptx
BilalHussainShah5
 
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
 
ppt_ooad.pdf
ppt_ooad.pdfppt_ooad.pdf
ppt_ooad.pdf
anuj962198
 
8 oo approach&uml-23_feb
8 oo approach&uml-23_feb8 oo approach&uml-23_feb
8 oo approach&uml-23_feb
Raj 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

Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
Jean Carlos Nunes Paixão
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
Israel Genealogy Research Association
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
heathfieldcps1
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
Bisnar Chase Personal Injury Attorneys
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Excellence Foundation for South Sudan
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
National Information Standards Organization (NISO)
 

Recently uploaded (20)

Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
A Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdfA Independência da América Espanhola LAPBOOK.pdf
A Independência da América Espanhola LAPBOOK.pdf
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
The Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collectionThe Diamonds of 2023-2024 in the IGRA collection
The Diamonds of 2023-2024 in the IGRA collection
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
The basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptxThe basics of sentences session 6pptx.pptx
The basics of sentences session 6pptx.pptx
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
 
Your Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective UpskillingYour Skill Boost Masterclass: Strategies for Effective Upskilling
Your Skill Boost Masterclass: Strategies for Effective Upskilling
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
Pollock and Snow "DEIA in the Scholarly Landscape, Session One: Setting Expec...
 

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