SlideShare una empresa de Scribd logo
1 de 16
OBJECT-ORIENTED DATA
MODEL :
Concept of Inheritance &
Persistent programming languages
Name : Vyanktesh Haribhau Dorlikar
Roll No : 1324
OODM
 Loosely speaking, an object corresponds to an
entity in the E-R model.
 An object represents a real world entity
(Person), a concept (Cricket Match), a logical
thing (Driving Licence), a physical thing (Car)
 An object associated with :
◦ A set of variables that contain the data for the object. The value of
each variable is itself an object.
◦ A set of messages to which the object responds; each message may
have zero, one, or more parameters.
◦ A set of methods, each of which is a body of code to implement a
message; a method returns a value as the response to the message
Class Definition
 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();
};
Inheritance
 Inheritance is the ability of an object
within the class hierarchy to inherit the
attributes and methods of the class above
it.
 E.g., Some part of the class of bank
customers is similar to class of bank
employees, although there are differences
◦ both share some variables and messages, e.g., name
and address.
◦ But there are variables and messages specific to each
class e.g., salary for employees and credit-rating for
customers.
 Every employee is a person; thus
employee is a specialization of person
 Similarly, customer is a specialization of
person.
PERSON : Name, Address, Birth date, Age
EMPLOYEE: Name, Address, Birth date, Age,
Salary, Hire Date, Seniority
CUSTOMER: Name, Address, Birth date, Age,
Major, GPA
OR:
EMPLOYEE subtype-of PERSON: Salary, Hire
Date, Seniority
CUSTOMER subtype-of PERSON: Major, GPA
Multiple Inheritance
 With multiple inheritance a class may have more than one super
class.
◦ The class/subclass relationship is represented by a directed acyclic
graph (DAG)
◦ Particularly useful when objects can be classified in more than one
way, which are independent of each other
 E.g. temporary/permanent is independent of
Officer/secretary/teller
◦ Eg . A person can play the roles of student, a teacher or
footballPlayer, or any combination of the three
 E.g., student who is teaching assistant who also play football
 Multiple Inheritance Create a subclass for each combination of
subclasses
 Need not create subclasses for combinations that are not possible
in the database being modeled
 A class inherits variables and methods from all its
superclasses
 There is potential for ambiguity when a
variable/message N with the same name is inherited
from two superclasses A and B
◦ No problem if the variable/message is defined in a shared
superclass
◦ Otherwise, do one of the following
 flag as an error,
 rename variables (A.N and B.N)
 choose one.
Example of Multiple Inheritance
(DAG)
Object-Oriented Languages
 Object-oriented concepts can be used in
different ways
◦ Object-orientation can be used as a design tool, and be encoded into,
for example, a relational database
(analogous to modeling data with E-R diagram and then converting to
a set of relations)
◦ The concepts of object orientation can be incorporated into a
programming language that is used to manipulate the database.
 Persistent programming languages – extend object-oriented
programming language to deal with databases by adding concepts
such as persistence and collections.
Persistent Programming Languages
 Persistent Programming languages allow
objects to be created and stored in a
database, and used directly from a
programming language
◦ allow data to be manipulated directly from the programming language
 No need to go through SQL.
◦ No need for explicit format (type) changes
 format changes are carried out transparently by system
 Without a persistent programming language, format changes becomes a
burden on the programmer
 More code to be written
 More chance of bugs
◦ allow objects to be manipulated in-memory
 no need to explicitly load from or store to the database
 Saved code, and saved overhead of loading/storing large amounts of
data
 Drawbacks of persistent programming
languages
◦ Due to power of most programming languages, it is easy to make
programming errors that damage the database.
◦ Complexity of languages makes automatic high-level optimization more
difficult.
Persistent C++ Systems
 C++ language allows support for persistence to be added
without changing the language
◦ Declare a class called Persistent Object with attributes and methods to
support persistence
◦ Overloading – ability to redefine standard function names and operators
(i.e., +, –, the pointer deference operator –>) when applied to new types
◦ Template classes help to build a type-safe system supporting collections
and persistent types.
 Providing persistence without extending the C++ language is
◦ relatively easy to implement
◦ but more difficult to use
Persistent Java Systems
 (object database management group)ODMG-3.0
defines extensions to Java for persistence
◦ Java does not support templates, so language extensions are required
 Class is made persistence capable by running a
post-processor on object code generated by the
Java compiler
◦ Contrast with pre-processor used in C++
◦ Post-processor adds mark_modified() automatically
 Defines collection types Dset(union, intersection, diff),
Dlist(creates list of objects), etc.
 Uses Java iterators, no need for new iterator class
 Transaction must start accessing database
from one of the root object (looked up
by name)
◦ finds other objects by following pointers from the root objects
 a fetched object are allocated space in
memory, but all objects not necessarily
fetched
◦ An object with space allocated but not yet fetched is called a hollow
object
◦ When a hollow object is accessed, its data is fetched from disk.
THANK YOU

Más contenido relacionado

La actualidad más candente

OODM-object oriented data model
OODM-object oriented data modelOODM-object oriented data model
OODM-object oriented data modelAnilPokhrel7
 
Object database standards, languages and design
Object database standards, languages and designObject database standards, languages and design
Object database standards, languages and designDabbal Singh Mahara
 
9. Object Relational Databases in DBMS
9. Object Relational Databases in DBMS9. Object Relational Databases in DBMS
9. Object Relational Databases in DBMSkoolkampus
 
Object Oriented Database Management System
Object Oriented Database Management SystemObject Oriented Database Management System
Object Oriented Database Management SystemAjay Jha
 
physical and logical data independence
physical and logical data independencephysical and logical data independence
physical and logical data independenceapoorva_upadhyay
 
Introduction of Database Design and Development
Introduction of Database Design and DevelopmentIntroduction of Database Design and Development
Introduction of Database Design and DevelopmentEr. Nawaraj Bhandari
 
The three level of data modeling
The three level of data modelingThe three level of data modeling
The three level of data modelingsharmila_yusof
 
Chapter 7 relation database language
Chapter 7 relation database languageChapter 7 relation database language
Chapter 7 relation database languageJafar Nesargi
 
Comparison of Relational Database and Object Oriented Database
Comparison of Relational Database and Object Oriented DatabaseComparison of Relational Database and Object Oriented Database
Comparison of Relational Database and Object Oriented DatabaseEditor IJMTER
 
Introduction to ER Diagrams
Introduction to ER DiagramsIntroduction to ER Diagrams
Introduction to ER DiagramsAdri Jovin
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational modelChirag vasava
 
All data models in dbms
All data models in dbmsAll data models in dbms
All data models in dbmsNaresh Kumar
 

La actualidad más candente (20)

OODM-object oriented data model
OODM-object oriented data modelOODM-object oriented data model
OODM-object oriented data model
 
PPL, OQL & oodbms
PPL, OQL & oodbmsPPL, OQL & oodbms
PPL, OQL & oodbms
 
Object database standards, languages and design
Object database standards, languages and designObject database standards, languages and design
Object database standards, languages and design
 
Introduction to odbms
Introduction to odbmsIntroduction to odbms
Introduction to odbms
 
9. Object Relational Databases in DBMS
9. Object Relational Databases in DBMS9. Object Relational Databases in DBMS
9. Object Relational Databases in DBMS
 
Odbms concepts
Odbms conceptsOdbms concepts
Odbms concepts
 
Object Oriented Database Management System
Object Oriented Database Management SystemObject Oriented Database Management System
Object Oriented Database Management System
 
Ch8
Ch8Ch8
Ch8
 
physical and logical data independence
physical and logical data independencephysical and logical data independence
physical and logical data independence
 
Introduction of Database Design and Development
Introduction of Database Design and DevelopmentIntroduction of Database Design and Development
Introduction of Database Design and Development
 
Chapter 3 Entity Relationship Model
Chapter 3 Entity Relationship ModelChapter 3 Entity Relationship Model
Chapter 3 Entity Relationship Model
 
The three level of data modeling
The three level of data modelingThe three level of data modeling
The three level of data modeling
 
Chapter 7 relation database language
Chapter 7 relation database languageChapter 7 relation database language
Chapter 7 relation database language
 
Comparison of Relational Database and Object Oriented Database
Comparison of Relational Database and Object Oriented DatabaseComparison of Relational Database and Object Oriented Database
Comparison of Relational Database and Object Oriented Database
 
Introduction to ER Diagrams
Introduction to ER DiagramsIntroduction to ER Diagrams
Introduction to ER Diagrams
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
 
Object oriented database
Object oriented databaseObject oriented database
Object oriented database
 
DBMS CS 4-5
DBMS CS 4-5DBMS CS 4-5
DBMS CS 4-5
 
RDBMS_Unit 01
RDBMS_Unit 01RDBMS_Unit 01
RDBMS_Unit 01
 
All data models in dbms
All data models in dbmsAll data models in dbms
All data models in dbms
 

Destacado

Data Modeling PPT
Data Modeling PPTData Modeling PPT
Data Modeling PPTTrinath
 
Object-Relational Database Systems(ORDBMSs)
Object-Relational Database Systems(ORDBMSs)Object-Relational Database Systems(ORDBMSs)
Object-Relational Database Systems(ORDBMSs)Sahan Walpitagamage
 
data modeling and models
data modeling and modelsdata modeling and models
data modeling and modelssabah N
 
Mark higginscrowd sourced_data_science_competitions
Mark higginscrowd sourced_data_science_competitionsMark higginscrowd sourced_data_science_competitions
Mark higginscrowd sourced_data_science_competitionsodsc
 
The Object Oriented Database System Manifesto
The Object Oriented Database System ManifestoThe Object Oriented Database System Manifesto
The Object Oriented Database System ManifestoBeat Signer
 
Encryptioon and key management introduction
Encryptioon and key management introductionEncryptioon and key management introduction
Encryptioon and key management introductionVyanktesh Dorlikar
 
A Federated In-Memory Database System for Life Sciences
A Federated In-Memory Database System for Life SciencesA Federated In-Memory Database System for Life Sciences
A Federated In-Memory Database System for Life SciencesMatthieu Schapranow
 
Modern Big Data Systems for Machine Learning
Modern Big Data Systems for Machine LearningModern Big Data Systems for Machine Learning
Modern Big Data Systems for Machine Learningzpektral
 
Module 3 Object Oriented Data Models Object Oriented notations
Module 3  Object Oriented Data Models Object Oriented notationsModule 3  Object Oriented Data Models Object Oriented notations
Module 3 Object Oriented Data Models Object Oriented notationsTaher Barodawala
 
Slide 2 data models
Slide 2 data modelsSlide 2 data models
Slide 2 data modelsVisakh V
 
Types of Data Validation
Types of Data ValidationTypes of Data Validation
Types of Data ValidationMetric Fox
 
Database Management system
Database Management systemDatabase Management system
Database Management systemVijay Thorat
 

Destacado (20)

Object oriented dbms
Object oriented dbmsObject oriented dbms
Object oriented dbms
 
Data models
Data modelsData models
Data models
 
Data Modeling PPT
Data Modeling PPTData Modeling PPT
Data Modeling PPT
 
Dbms models
Dbms modelsDbms models
Dbms models
 
Object-Relational Database Systems(ORDBMSs)
Object-Relational Database Systems(ORDBMSs)Object-Relational Database Systems(ORDBMSs)
Object-Relational Database Systems(ORDBMSs)
 
data modeling and models
data modeling and modelsdata modeling and models
data modeling and models
 
Mark higginscrowd sourced_data_science_competitions
Mark higginscrowd sourced_data_science_competitionsMark higginscrowd sourced_data_science_competitions
Mark higginscrowd sourced_data_science_competitions
 
The Object Oriented Database System Manifesto
The Object Oriented Database System ManifestoThe Object Oriented Database System Manifesto
The Object Oriented Database System Manifesto
 
Ibm cell
Ibm cell Ibm cell
Ibm cell
 
Encryptioon and key management introduction
Encryptioon and key management introductionEncryptioon and key management introduction
Encryptioon and key management introduction
 
wireless biometric system
wireless biometric systemwireless biometric system
wireless biometric system
 
Object oriented databases
Object oriented databasesObject oriented databases
Object oriented databases
 
A Federated In-Memory Database System for Life Sciences
A Federated In-Memory Database System for Life SciencesA Federated In-Memory Database System for Life Sciences
A Federated In-Memory Database System for Life Sciences
 
Modern Big Data Systems for Machine Learning
Modern Big Data Systems for Machine LearningModern Big Data Systems for Machine Learning
Modern Big Data Systems for Machine Learning
 
Data validation option
Data validation optionData validation option
Data validation option
 
Module 3 Object Oriented Data Models Object Oriented notations
Module 3  Object Oriented Data Models Object Oriented notationsModule 3  Object Oriented Data Models Object Oriented notations
Module 3 Object Oriented Data Models Object Oriented notations
 
Slide 2 data models
Slide 2 data modelsSlide 2 data models
Slide 2 data models
 
Athena
AthenaAthena
Athena
 
Types of Data Validation
Types of Data ValidationTypes of Data Validation
Types of Data Validation
 
Database Management system
Database Management systemDatabase Management system
Database Management system
 

Similar a Object oriented data model

Ube Databases
Ube DatabasesUbe Databases
Ube DatabasesDang Tuan
 
Introduction to Java -unit-1
Introduction to Java -unit-1Introduction to Java -unit-1
Introduction to Java -unit-1RubaNagarajan
 
Ch.1 oop introduction, classes and objects
Ch.1 oop introduction, classes and objectsCh.1 oop introduction, classes and objects
Ch.1 oop introduction, classes and objectsITNet
 
Adv DB - Full Handout.pdf
Adv DB - Full Handout.pdfAdv DB - Full Handout.pdf
Adv DB - Full Handout.pdf3BRBoruMedia
 
Object oriented software engineering concepts
Object oriented software engineering conceptsObject oriented software engineering concepts
Object oriented software engineering conceptsKomal Singh
 
OOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdfOOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdfHouseMusica
 
C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01Zafor Iqbal
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptintroduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptkaavyashruthi
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptintroduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptRamadossSundaramoort1
 
C++ programming introduction
C++ programming introductionC++ programming introduction
C++ programming introductionsandeep54552
 
Object Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft DeveloperObject Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft DeveloperLee Greffin
 
JAVA-PPT'S.pptx
JAVA-PPT'S.pptxJAVA-PPT'S.pptx
JAVA-PPT'S.pptxRaazIndia
 
JAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptxJAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptxKunalYadav65140
 

Similar a Object oriented data model (20)

Ube Databases
Ube DatabasesUbe Databases
Ube Databases
 
Introduction to Java -unit-1
Introduction to Java -unit-1Introduction to Java -unit-1
Introduction to Java -unit-1
 
Ch.1 oop introduction, classes and objects
Ch.1 oop introduction, classes and objectsCh.1 oop introduction, classes and objects
Ch.1 oop introduction, classes and objects
 
oodb.ppt
oodb.pptoodb.ppt
oodb.ppt
 
Adv DB - Full Handout.pdf
Adv DB - Full Handout.pdfAdv DB - Full Handout.pdf
Adv DB - Full Handout.pdf
 
Object oriented software engineering concepts
Object oriented software engineering conceptsObject oriented software engineering concepts
Object oriented software engineering concepts
 
Lecture 01 - Basic Concept About OOP With Python
Lecture 01 - Basic Concept About OOP With PythonLecture 01 - Basic Concept About OOP With Python
Lecture 01 - Basic Concept About OOP With Python
 
OOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdfOOP lesson1 and Variables.pdf
OOP lesson1 and Variables.pdf
 
Oodb
OodbOodb
Oodb
 
C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01C Sharp: Basic to Intermediate Part 01
C Sharp: Basic to Intermediate Part 01
 
Unit 5.ppt
Unit 5.pptUnit 5.ppt
Unit 5.ppt
 
Advance oops concepts
Advance oops conceptsAdvance oops concepts
Advance oops concepts
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptintroduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.ppt
 
introduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.pptintroduction-to-object-oriented-programming.ppt
introduction-to-object-oriented-programming.ppt
 
OOP_1_TEG
OOP_1_TEGOOP_1_TEG
OOP_1_TEG
 
C++ programming introduction
C++ programming introductionC++ programming introduction
C++ programming introduction
 
Cs2305 programming paradigms lecturer notes
Cs2305   programming paradigms lecturer notesCs2305   programming paradigms lecturer notes
Cs2305 programming paradigms lecturer notes
 
Object Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft DeveloperObject Oriented Programming Overview for the PeopleSoft Developer
Object Oriented Programming Overview for the PeopleSoft Developer
 
JAVA-PPT'S.pptx
JAVA-PPT'S.pptxJAVA-PPT'S.pptx
JAVA-PPT'S.pptx
 
JAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptxJAVA-PPT'S-complete-chrome.pptx
JAVA-PPT'S-complete-chrome.pptx
 

Último

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 

Último (20)

Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 

Object oriented data model

  • 1. OBJECT-ORIENTED DATA MODEL : Concept of Inheritance & Persistent programming languages Name : Vyanktesh Haribhau Dorlikar Roll No : 1324
  • 2. OODM  Loosely speaking, an object corresponds to an entity in the E-R model.  An object represents a real world entity (Person), a concept (Cricket Match), a logical thing (Driving Licence), a physical thing (Car)  An object associated with : ◦ A set of variables that contain the data for the object. The value of each variable is itself an object. ◦ A set of messages to which the object responds; each message may have zero, one, or more parameters. ◦ A set of methods, each of which is a body of code to implement a message; a method returns a value as the response to the message
  • 3. Class Definition  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(); };
  • 4. Inheritance  Inheritance is the ability of an object within the class hierarchy to inherit the attributes and methods of the class above it.
  • 5.  E.g., Some part of the class of bank customers is similar to class of bank employees, although there are differences ◦ both share some variables and messages, e.g., name and address. ◦ But there are variables and messages specific to each class e.g., salary for employees and credit-rating for customers.  Every employee is a person; thus employee is a specialization of person  Similarly, customer is a specialization of person.
  • 6. PERSON : Name, Address, Birth date, Age EMPLOYEE: Name, Address, Birth date, Age, Salary, Hire Date, Seniority CUSTOMER: Name, Address, Birth date, Age, Major, GPA OR: EMPLOYEE subtype-of PERSON: Salary, Hire Date, Seniority CUSTOMER subtype-of PERSON: Major, GPA
  • 7. Multiple Inheritance  With multiple inheritance a class may have more than one super class. ◦ The class/subclass relationship is represented by a directed acyclic graph (DAG) ◦ Particularly useful when objects can be classified in more than one way, which are independent of each other  E.g. temporary/permanent is independent of Officer/secretary/teller ◦ Eg . A person can play the roles of student, a teacher or footballPlayer, or any combination of the three  E.g., student who is teaching assistant who also play football  Multiple Inheritance Create a subclass for each combination of subclasses  Need not create subclasses for combinations that are not possible in the database being modeled
  • 8.  A class inherits variables and methods from all its superclasses  There is potential for ambiguity when a variable/message N with the same name is inherited from two superclasses A and B ◦ No problem if the variable/message is defined in a shared superclass ◦ Otherwise, do one of the following  flag as an error,  rename variables (A.N and B.N)  choose one.
  • 9. Example of Multiple Inheritance (DAG)
  • 10. Object-Oriented Languages  Object-oriented concepts can be used in different ways ◦ Object-orientation can be used as a design tool, and be encoded into, for example, a relational database (analogous to modeling data with E-R diagram and then converting to a set of relations) ◦ The concepts of object orientation can be incorporated into a programming language that is used to manipulate the database.  Persistent programming languages – extend object-oriented programming language to deal with databases by adding concepts such as persistence and collections.
  • 11. Persistent Programming Languages  Persistent Programming languages allow objects to be created and stored in a database, and used directly from a programming language ◦ allow data to be manipulated directly from the programming language  No need to go through SQL. ◦ No need for explicit format (type) changes  format changes are carried out transparently by system  Without a persistent programming language, format changes becomes a burden on the programmer  More code to be written  More chance of bugs ◦ allow objects to be manipulated in-memory  no need to explicitly load from or store to the database  Saved code, and saved overhead of loading/storing large amounts of data
  • 12.  Drawbacks of persistent programming languages ◦ Due to power of most programming languages, it is easy to make programming errors that damage the database. ◦ Complexity of languages makes automatic high-level optimization more difficult.
  • 13. Persistent C++ Systems  C++ language allows support for persistence to be added without changing the language ◦ Declare a class called Persistent Object with attributes and methods to support persistence ◦ Overloading – ability to redefine standard function names and operators (i.e., +, –, the pointer deference operator –>) when applied to new types ◦ Template classes help to build a type-safe system supporting collections and persistent types.  Providing persistence without extending the C++ language is ◦ relatively easy to implement ◦ but more difficult to use
  • 14. Persistent Java Systems  (object database management group)ODMG-3.0 defines extensions to Java for persistence ◦ Java does not support templates, so language extensions are required  Class is made persistence capable by running a post-processor on object code generated by the Java compiler ◦ Contrast with pre-processor used in C++ ◦ Post-processor adds mark_modified() automatically  Defines collection types Dset(union, intersection, diff), Dlist(creates list of objects), etc.  Uses Java iterators, no need for new iterator class
  • 15.  Transaction must start accessing database from one of the root object (looked up by name) ◦ finds other objects by following pointers from the root objects  a fetched object are allocated space in memory, but all objects not necessarily fetched ◦ An object with space allocated but not yet fetched is called a hollow object ◦ When a hollow object is accessed, its data is fetched from disk.