SlideShare ist ein Scribd-Unternehmen logo
1 von 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

Weitere ähnliche Inhalte

Ähnlich wie 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
 

Ähnlich wie 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
 

Kürzlich hochgeladen

Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.MateoGardella
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterMateoGardella
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 

Kürzlich hochgeladen (20)

Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 

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