SlideShare a Scribd company logo
03/12/2001 1
Chap. 4
What Is Object-Orientation?
Object Oriented Systems Analysis and Design
Using UML, (3rd Edition), McGraw Hill
2
In This Lecture You Will Learn:In This Lecture You Will Learn:
The fundamental concepts of object-
orientation
The justifications for an object-oriented
approach
3
Basic ConceptsBasic Concepts
The main concepts introduced here are:
– Objects, Classes and Instances
– Object State
– Generalization and Specialization
– Message-passing and Encapsulation
– Polymorphism
4
ObjectsObjects
An object is:
“an abstraction of something in a
problem domain, reflecting the
capabilities of the system to
– keep information about it,
– interact with it,
– or both.”
Coad and Yourdon (1990)
5
AbstractionAbstraction
A form of representation that includes
only what is important or interesting
from a particular viewpoint
– Map : never shows detail of the territory
Road maps : showing roads and places
Geological maps : showing rocks and surfaces
6
ObjectsObjects
“Objects have state, behaviour and
identity.”
Booch (1994)
State: the condition of an object at any
moment, affecting how it can behave
Behaviour: what an object can do, how
it can respond to events and stimuli
Identity: each object is unique
7
Examples of ObjectsExamples of Objects
Object
A person. ‘Hussain Pervez.’ Speak, walk, read.
Studying, resting,
qualified.
A shirt.
My favourite button
white denim shirt.
Shrink, stain, rip. Pressed, dirty,
worn.
A sale. Sale no #0015,
18/05/05.
Earn loyalty points. Invoiced,
cancelled.
Identity Behaviour State
A bottle of
ketchup.
This bottle of
ketchup.
Spill in transit. Unsold, opened,
empty.
8
Class and InstanceClass and Instance
All objects are instances of some class
Class:
A description of a set of objects with
similar
– features (attributes, operations, links);
– semantics;
– constraints (e.g. when and whether an object can
be instantiated).
An abstract description for the specified
logical similarities between those objects
OMG (2004)
9
Class and InstanceClass and Instance
An object is an instance of some class
So, instance = object
– but also carries connotations of the class to
which the object belongs
Instances of a class are similar in their:
– Structure: what it knows, what information
it holds, what links it has to other objects
– Behaviour: what an object can do
10
Information structuresInformation structures
for two classesfor two classes
Class Characteristics Class Characteristics
Staff Name
Staff number
Start date
Client Name
Address
Phone number
Fax number
Email address
11
Generalization andGeneralization and
SpecializationSpecialization
Classification is hierarchic in nature
For example, a person may be an
employee, a customer, a supplier of a
service
An employee may be paid monthly,
weekly or hourly
An hourly paid employee may be a
driver, a cleaner, a sales assistant
12
Specialization HierarchySpecialization Hierarchy
Person
Employee Customer Supplier
monthly
paid
weekly
paid
hourly
paid
Driver Cleaner Sales
assistant
More general
(superclasses)
More specialized
(subclasses)
13
Generalization andGeneralization and
SpecializationSpecialization
Specialization adds additional
information:
Person
name
date of birth
gender
title
HourlyPaidDriver
startDate
standardRate
overtimeRate
licenceType
General (superclass) Specialized (subclass)
14
InheritanceInheritance
The whole description of a superclass applies
to all its subclasses, including:
– Information structure (including associations)
– Behaviour
Often known loosely as inheritance
Inheritance is how an O-O programming
language implements generalization /
specialization
15
MessageMessage--passingpassing
Several objects may collaborate to fulfil
each system action
These objects communicate by sending
each other messages
A way of insulating each object from
the need to ‘know’ any of the internal
details of other objects.
16
MessageMessage--passing andpassing and
EncapsulationEncapsulation
Message from another object
requests a service.
Operation called only via valid
operation signature.
Data accessed only by
object’s own operations.
An object’s data
is hidden
(encapsulated).
An outer layer of
operation signatures…
…gives access to middle
layer of operations…
…which can access
inner core of data
‘Layers of an onion’
model of an object:
17
PolymorphismPolymorphism
An ability to appear as many forms
Polymorphism allows one message to be sent to
objects of different classes
– Each object responds to the message in a different way
Sending object need not know what kind of object
will receive the message
Each receiving object knows how to respond
appropriately
For example, a ‘Calculate Pay’ operation
18
An Example of PolymorphismAn Example of Polymorphism
(Overriding)(Overriding)
:MonthlyPayPrint
:FullTimeEmployee
:PartTimeEmployee
:TempEmployee
Fixed monthly
amount depends only
on employee grade
Variable monthly
amount depends on
grade and hours
Fixed monthly amount
depends on grade, but
no pension deductions
Pay Clerk
1: getTotalPay()
2a: calculatePay()
2b: calculatePay()
2c: calculatePay()
19
Advantages of OAdvantages of O--OO
Can save effort
– Reuse of generalized components cuts
work, cost and time
Can improve software quality
– Encapsulation increases modularity
– Sub-systems less coupled to each other
– Better translations between analysis and
design models and working code

More Related Content

What's hot

Object database standards, languages and design
Object database standards, languages and designObject database standards, languages and design
Object database standards, languages and design
Dabbal Singh Mahara
 
Basic concept of Object Oriented Programming
Basic concept of Object Oriented Programming Basic concept of Object Oriented Programming
Basic concept of Object Oriented Programming
Prognoz Technologies Pvt. Ltd.
 
Abstraction file
Abstraction fileAbstraction file
Abstraction file
Hoang Nguyen
 
Object Oriented Principles
Object Oriented PrinciplesObject Oriented Principles
Object Oriented Principles
Emprovise
 
[OOP - Lec 08] Encapsulation (Information Hiding)
[OOP - Lec 08] Encapsulation (Information Hiding)[OOP - Lec 08] Encapsulation (Information Hiding)
[OOP - Lec 08] Encapsulation (Information Hiding)
Muhammad Hammad Waseem
 
Oo ps concepts in c++
Oo ps concepts in c++Oo ps concepts in c++
Oo ps concepts in c++
Hemant Saini
 
Modeling a Probabilistic Ontology for Maritime Domain Awareness
Modeling a Probabilistic Ontology for Maritime Domain AwarenessModeling a Probabilistic Ontology for Maritime Domain Awareness
Modeling a Probabilistic Ontology for Maritime Domain AwarenessRommel Carvalho
 

What's hot (7)

Object database standards, languages and design
Object database standards, languages and designObject database standards, languages and design
Object database standards, languages and design
 
Basic concept of Object Oriented Programming
Basic concept of Object Oriented Programming Basic concept of Object Oriented Programming
Basic concept of Object Oriented Programming
 
Abstraction file
Abstraction fileAbstraction file
Abstraction file
 
Object Oriented Principles
Object Oriented PrinciplesObject Oriented Principles
Object Oriented Principles
 
[OOP - Lec 08] Encapsulation (Information Hiding)
[OOP - Lec 08] Encapsulation (Information Hiding)[OOP - Lec 08] Encapsulation (Information Hiding)
[OOP - Lec 08] Encapsulation (Information Hiding)
 
Oo ps concepts in c++
Oo ps concepts in c++Oo ps concepts in c++
Oo ps concepts in c++
 
Modeling a Probabilistic Ontology for Maritime Domain Awareness
Modeling a Probabilistic Ontology for Maritime Domain AwarenessModeling a Probabilistic Ontology for Maritime Domain Awareness
Modeling a Probabilistic Ontology for Maritime Domain Awareness
 

Viewers also liked

Ciampolillo giuseppe anza' salvatore procedimento 9916 2011 memoria udienza 2...
Ciampolillo giuseppe anza' salvatore procedimento 9916 2011 memoria udienza 2...Ciampolillo giuseppe anza' salvatore procedimento 9916 2011 memoria udienza 2...
Ciampolillo giuseppe anza' salvatore procedimento 9916 2011 memoria udienza 2...Pino Ciampolillo
 
Power pointmarch2013
Power pointmarch2013Power pointmarch2013
Power pointmarch2013Van Ly
 
The history of computers in education
The history of computers in educationThe history of computers in education
The history of computers in educationMarianang
 
SourceLair Open Coffee Patras 24-10-2014
SourceLair   Open Coffee Patras 24-10-2014SourceLair   Open Coffee Patras 24-10-2014
SourceLair Open Coffee Patras 24-10-2014
Christos Konstandinidis
 
La Cosa Più terribile e La mafioso dell'antimafia
La Cosa Più terribile e La mafioso dell'antimafiaLa Cosa Più terribile e La mafioso dell'antimafia
La Cosa Più terribile e La mafioso dell'antimafia
Pino Ciampolillo
 
ITALCEMENTI
 ITALCEMENTI  ITALCEMENTI
ITALCEMENTI
Pino Ciampolillo
 
Piano aria sicilia glossario da pag 237 a pag 239 piano veneto da pag 233 a ...
Piano aria sicilia glossario da pag 237 a pag 239  piano veneto da pag 233 a ...Piano aria sicilia glossario da pag 237 a pag 239  piano veneto da pag 233 a ...
Piano aria sicilia glossario da pag 237 a pag 239 piano veneto da pag 233 a ...
Pino Ciampolillo
 

Viewers also liked (9)

Ciampolillo giuseppe anza' salvatore procedimento 9916 2011 memoria udienza 2...
Ciampolillo giuseppe anza' salvatore procedimento 9916 2011 memoria udienza 2...Ciampolillo giuseppe anza' salvatore procedimento 9916 2011 memoria udienza 2...
Ciampolillo giuseppe anza' salvatore procedimento 9916 2011 memoria udienza 2...
 
Power pointmarch2013
Power pointmarch2013Power pointmarch2013
Power pointmarch2013
 
算数1
算数1算数1
算数1
 
The history of computers in education
The history of computers in educationThe history of computers in education
The history of computers in education
 
Anza' salvatore pdf
Anza' salvatore pdfAnza' salvatore pdf
Anza' salvatore pdf
 
SourceLair Open Coffee Patras 24-10-2014
SourceLair   Open Coffee Patras 24-10-2014SourceLair   Open Coffee Patras 24-10-2014
SourceLair Open Coffee Patras 24-10-2014
 
La Cosa Più terribile e La mafioso dell'antimafia
La Cosa Più terribile e La mafioso dell'antimafiaLa Cosa Più terribile e La mafioso dell'antimafia
La Cosa Più terribile e La mafioso dell'antimafia
 
ITALCEMENTI
 ITALCEMENTI  ITALCEMENTI
ITALCEMENTI
 
Piano aria sicilia glossario da pag 237 a pag 239 piano veneto da pag 233 a ...
Piano aria sicilia glossario da pag 237 a pag 239  piano veneto da pag 233 a ...Piano aria sicilia glossario da pag 237 a pag 239  piano veneto da pag 233 a ...
Piano aria sicilia glossario da pag 237 a pag 239 piano veneto da pag 233 a ...
 

Similar to Bennett chap 4

Ooad notes
Ooad notesOoad notes
Ooad notes
NancyJP
 
Object oriented programming concept
Object oriented programming conceptObject oriented programming concept
Object oriented programming concept
Pina Parmar
 
SE_Lec 06_Object Oriented Analysis and Design
SE_Lec 06_Object Oriented Analysis and DesignSE_Lec 06_Object Oriented Analysis and Design
SE_Lec 06_Object Oriented Analysis and Design
Amr E. Mohamed
 
SE18_Lec 06_Object Oriented Analysis and Design
SE18_Lec 06_Object Oriented Analysis and DesignSE18_Lec 06_Object Oriented Analysis and Design
SE18_Lec 06_Object Oriented Analysis and Design
Amr E. Mohamed
 
object modeling chapter 4 for students a
object modeling chapter 4 for students aobject modeling chapter 4 for students a
object modeling chapter 4 for students a
SaudFlash1
 
Oops slide
Oops slide Oops slide
Oops slide
Ashok Sharma
 
L1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdfL1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdf
BhanuJatinSingh
 
OOPS in Java
OOPS in JavaOOPS in Java
OOPS in Java
Zeeshan Khan
 
07 intro2 oop
07 intro2 oop07 intro2 oop
07 intro2 oop
Daiva Adisurya
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
AyushiDubey19
 
OO Development 4 - Object Concepts
OO Development 4 - Object ConceptsOO Development 4 - Object Concepts
OO Development 4 - Object Concepts
Randy Connolly
 
OOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptxOOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptx
ShobhitSrivastava15887
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
Amit Soni (CTFL)
 
Introduction of OOPs
Introduction of OOPsIntroduction of OOPs
Introduction of OOPs
Integral University
 
Bt8901 objective oriented systems1
Bt8901 objective oriented systems1Bt8901 objective oriented systems1
Bt8901 objective oriented systems1
Techglyphs
 
M01_OO_Intro.ppt
M01_OO_Intro.pptM01_OO_Intro.ppt
M01_OO_Intro.ppt
RojaPogul1
 
Ooad ch 1_2
Ooad ch 1_2Ooad ch 1_2
Ooad ch 1_2
anujabeatrice2
 
Classes and Objects
Classes and Objects  Classes and Objects
Classes and Objects
yndaravind
 

Similar to Bennett chap 4 (20)

Ooad notes
Ooad notesOoad notes
Ooad notes
 
Object oriented programming concept
Object oriented programming conceptObject oriented programming concept
Object oriented programming concept
 
Ashish oot
Ashish ootAshish oot
Ashish oot
 
SE_Lec 06_Object Oriented Analysis and Design
SE_Lec 06_Object Oriented Analysis and DesignSE_Lec 06_Object Oriented Analysis and Design
SE_Lec 06_Object Oriented Analysis and Design
 
SE18_Lec 06_Object Oriented Analysis and Design
SE18_Lec 06_Object Oriented Analysis and DesignSE18_Lec 06_Object Oriented Analysis and Design
SE18_Lec 06_Object Oriented Analysis and Design
 
object modeling chapter 4 for students a
object modeling chapter 4 for students aobject modeling chapter 4 for students a
object modeling chapter 4 for students a
 
Oops slide
Oops slide Oops slide
Oops slide
 
L1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdfL1-Introduction to OOPs concepts.pdf
L1-Introduction to OOPs concepts.pdf
 
OOPS in Java
OOPS in JavaOOPS in Java
OOPS in Java
 
07 intro2 oop
07 intro2 oop07 intro2 oop
07 intro2 oop
 
Week1
Week1Week1
Week1
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
OO Development 4 - Object Concepts
OO Development 4 - Object ConceptsOO Development 4 - Object Concepts
OO Development 4 - Object Concepts
 
OOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptxOOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptx
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
Introduction of OOPs
Introduction of OOPsIntroduction of OOPs
Introduction of OOPs
 
Bt8901 objective oriented systems1
Bt8901 objective oriented systems1Bt8901 objective oriented systems1
Bt8901 objective oriented systems1
 
M01_OO_Intro.ppt
M01_OO_Intro.pptM01_OO_Intro.ppt
M01_OO_Intro.ppt
 
Ooad ch 1_2
Ooad ch 1_2Ooad ch 1_2
Ooad ch 1_2
 
Classes and Objects
Classes and Objects  Classes and Objects
Classes and Objects
 

Recently uploaded

Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
DianaGray10
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 

Recently uploaded (20)

Connector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a buttonConnector Corner: Automate dynamic content and events by pushing a button
Connector Corner: Automate dynamic content and events by pushing a button
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 

Bennett chap 4

  • 1. 03/12/2001 1 Chap. 4 What Is Object-Orientation? Object Oriented Systems Analysis and Design Using UML, (3rd Edition), McGraw Hill
  • 2. 2 In This Lecture You Will Learn:In This Lecture You Will Learn: The fundamental concepts of object- orientation The justifications for an object-oriented approach
  • 3. 3 Basic ConceptsBasic Concepts The main concepts introduced here are: – Objects, Classes and Instances – Object State – Generalization and Specialization – Message-passing and Encapsulation – Polymorphism
  • 4. 4 ObjectsObjects An object is: “an abstraction of something in a problem domain, reflecting the capabilities of the system to – keep information about it, – interact with it, – or both.” Coad and Yourdon (1990)
  • 5. 5 AbstractionAbstraction A form of representation that includes only what is important or interesting from a particular viewpoint – Map : never shows detail of the territory Road maps : showing roads and places Geological maps : showing rocks and surfaces
  • 6. 6 ObjectsObjects “Objects have state, behaviour and identity.” Booch (1994) State: the condition of an object at any moment, affecting how it can behave Behaviour: what an object can do, how it can respond to events and stimuli Identity: each object is unique
  • 7. 7 Examples of ObjectsExamples of Objects Object A person. ‘Hussain Pervez.’ Speak, walk, read. Studying, resting, qualified. A shirt. My favourite button white denim shirt. Shrink, stain, rip. Pressed, dirty, worn. A sale. Sale no #0015, 18/05/05. Earn loyalty points. Invoiced, cancelled. Identity Behaviour State A bottle of ketchup. This bottle of ketchup. Spill in transit. Unsold, opened, empty.
  • 8. 8 Class and InstanceClass and Instance All objects are instances of some class Class: A description of a set of objects with similar – features (attributes, operations, links); – semantics; – constraints (e.g. when and whether an object can be instantiated). An abstract description for the specified logical similarities between those objects OMG (2004)
  • 9. 9 Class and InstanceClass and Instance An object is an instance of some class So, instance = object – but also carries connotations of the class to which the object belongs Instances of a class are similar in their: – Structure: what it knows, what information it holds, what links it has to other objects – Behaviour: what an object can do
  • 10. 10 Information structuresInformation structures for two classesfor two classes Class Characteristics Class Characteristics Staff Name Staff number Start date Client Name Address Phone number Fax number Email address
  • 11. 11 Generalization andGeneralization and SpecializationSpecialization Classification is hierarchic in nature For example, a person may be an employee, a customer, a supplier of a service An employee may be paid monthly, weekly or hourly An hourly paid employee may be a driver, a cleaner, a sales assistant
  • 12. 12 Specialization HierarchySpecialization Hierarchy Person Employee Customer Supplier monthly paid weekly paid hourly paid Driver Cleaner Sales assistant More general (superclasses) More specialized (subclasses)
  • 13. 13 Generalization andGeneralization and SpecializationSpecialization Specialization adds additional information: Person name date of birth gender title HourlyPaidDriver startDate standardRate overtimeRate licenceType General (superclass) Specialized (subclass)
  • 14. 14 InheritanceInheritance The whole description of a superclass applies to all its subclasses, including: – Information structure (including associations) – Behaviour Often known loosely as inheritance Inheritance is how an O-O programming language implements generalization / specialization
  • 15. 15 MessageMessage--passingpassing Several objects may collaborate to fulfil each system action These objects communicate by sending each other messages A way of insulating each object from the need to ‘know’ any of the internal details of other objects.
  • 16. 16 MessageMessage--passing andpassing and EncapsulationEncapsulation Message from another object requests a service. Operation called only via valid operation signature. Data accessed only by object’s own operations. An object’s data is hidden (encapsulated). An outer layer of operation signatures… …gives access to middle layer of operations… …which can access inner core of data ‘Layers of an onion’ model of an object:
  • 17. 17 PolymorphismPolymorphism An ability to appear as many forms Polymorphism allows one message to be sent to objects of different classes – Each object responds to the message in a different way Sending object need not know what kind of object will receive the message Each receiving object knows how to respond appropriately For example, a ‘Calculate Pay’ operation
  • 18. 18 An Example of PolymorphismAn Example of Polymorphism (Overriding)(Overriding) :MonthlyPayPrint :FullTimeEmployee :PartTimeEmployee :TempEmployee Fixed monthly amount depends only on employee grade Variable monthly amount depends on grade and hours Fixed monthly amount depends on grade, but no pension deductions Pay Clerk 1: getTotalPay() 2a: calculatePay() 2b: calculatePay() 2c: calculatePay()
  • 19. 19 Advantages of OAdvantages of O--OO Can save effort – Reuse of generalized components cuts work, cost and time Can improve software quality – Encapsulation increases modularity – Sub-systems less coupled to each other – Better translations between analysis and design models and working code