SlideShare a Scribd company logo
1 of 39
3. Analysis
Overview of OO concepts
Classes and objects
Finding classes
Class Diagram
3.2 Classes and Objects
Classes
Associations
(Static Modelling)
Classes and Objects
• 1 Classes & Objects
• 2 The Class Diagram
• 3 Associations
• 4 Aggregation & Composition
• 5 Generalisation
Classes and Objects
• Classes, Objects and their relationships are
the primary way to model.
• A class is like a type and therefore an
object is like a variable.
An Object has ...
• Attributes (data).
• Behaviour (operations).
• State (memory)
• Identity
• Responsibilities
An example Object ...
• A sensor:
– Attributes (data): Value, Rate of change
– Behaviour (operations): acquire, report ...
– State (memory) Last value, Last Rate
– Identity: Robot arm joint sensor
– Responsibilities: Gives co-ordinates for arm
The Class: Sensor
• All sensors share certain characteristics
hence we have a class of sensors.
• But each individual example is an object.
• (An instance of the class)
Attributes
• Describe the state and characteristics of the
object.
• Must be typed, primitives like integer, real,
Boolean, point, area, enumeration. May be
language specific.
• Visibility may be public (+), private (-) or
protected (#).
Attributes (Contd.)
• Class variables have scope across every
instance of class, change one changes all.
• Property strings may be used to define
allowable properties of an attribute. Used for
enumeration types.
• Syntax
– visibility name : type-expression = initial-value
{property-string}
• Only name and type are mandatory.
Example Class
Sensor
+ Linear_Value :Real
+ Rate_Of_Change : Real = 0.0
+ Sensor_Name : String
+ Sensor_Location: String
- Controller: String = “Unspecified”
- number_of_sensors: Integer
+ status: Status = ON{ON, OFF}
Name, bold
Public, typed
Default value
Class variable
Private, typed,
default value
Property
Operations
• Operations manipulate attributes and
perform other tasks.
• Scope is the Class.
• Operation signature is composed of name,
parameters and return type.
– name(parameter-list) return-type-expression
• Scope and visibility rules apply.
Syntactic Constructs
• Formal syntax is as follows
– visibility name(parameter-list) return-
type-expression {property-string}
• parameter-list specified as …
– name: type-expression=default-value
• All operations must have unique signature.
• Default values on parameters are Ok.
Figure
-size: Size
-pos: Position
+figCounter: Integer
+draw()
+resize(percentX: Integer=25, percentY=30)
+returnPos(): Position
incCounter(): Integer
MyFigure.resize(10,10)
MyFigure.resize(27)
MyFigure.resize()
percentX=10, percentY=10
percentX=27, percentY=30
percentX=25, percentY=30
Signatures ?
Class scope ?
Defaults ?
On the Class Diagram
Cardinality Examples
Rent
Member Video
Employee
Name:String
Number:EmpNo
Dept
Name:Name
Has
Customer Account
AccNo:Account
Balance: Real
1..*
0..1 *
Class & Object Representation
Rent
Member Video
Sunset Boulevard: Video
Night for day: Video
John Doe: Member
0..1 *
Navigable Associations
• Used to indicate responsibility, later may
be translated into pointer mechanism.
• May be bi-directional.
Person Car
owns
0..*
Recursion
• Self referential construct.
• Complex construct, may not be supported
by target language.
User
Directory container
contents
owner
authorised user
* *
*
*
0..1
Qualified Associations
• A qualified association relates two Object
Classes and a “qualifier”.
• One-to-many and many-to-many
associations may be qualified.
• The qualifier distinguishes among the set
of objects at the “many” end of an
association.
Directory File
Is more clearly expressed as .....
Directory File
File name
*
Qualified Associations
Or-Association
• A constraint on two or more associations.
• Objects of a class may participate in at
most one of the associations at a time.
Insurance Co
Insurance
Contract
Person Company
1 0..*
{or}
0..*
1..*
1..*
Ordered Association
• Shows implicit order of associations.
• Default is unordered.
Window Screen
Controller Sensor
{ordered}
{ordered}
Visible on
polls
*
*
Association Class
• Class may be attached to association, and
not another class.
Person
Company
Employment
Period: dateRange
*
0..1
Association Class
employer
Shared Aggregation
Team Person
Members
* *
• One person may be a member of many teams.
• Person is part of team, shared by N teams.
Composition Aggregation
• More restrictive. Strong ownership here.
• Rules
– Parts live inside whole, parts die with whole,
like automatic variables.
– Multiplicity on whole side must be “0..1”, on
part side may be anything.
• Composition aggregation forms a tree of
parts, shared forms a network of parts.
Three Composition Notations
Window
Text
Listbox
Button
menu
*
*
*
*
Text
Listbox
Button
menu
Window
*
*
*
*
• Component not bold.
• May use syntax
– rollname:classname
• Multiplicity shown.
Generalisation
• Generalisation and Inheritance allow
sharing of similarities among Classes while
also preserving differences.
• Inheritance refers to mechanism of sharing
attributes & operations between subclasses
and their superclass.
• Default values of attributes & methods for
operations may be overridden in subclass.
Example
Financial service
Mortgage Personal Loan Insurance Pension
General
Specific
Subclass Concretises
FormControl
ButtonElement InputElement
Display(){abstract}
Display() Display()
Implementation Issue
FormControl
ButtonElement
Display(){abstract}
Display() Display()
Client
Display()
• When Client invokes
Display(),
method is bound at
runtime.
• Like pure virtual
function in C++.
InputElement
Constrained Generalization
• Generalisations may be
– Overlapping: inherit multiple subclasses with
common superclass.
– Disjoint: opposite to overlapping.
– Complete: all subclasses specified, no more
allowed.
– Incomplete: more subclasses may be added to
hierarchy.
Engineering Process for Allocation
of Responsibility
• Process will lay down rules for timing of
allocation of responsibilities to classes from
use cases.
• May use domain analysis, find classes &
relationships, then allocate from use cases.
• May find classes from use cases.
Domain Analysis
• Use Natural Language
Problem Domain
Natural
Language
Class Description
• Develop a Class description, either in
textual prose or some other structured
form. E.G. using a customer in a Bank
– Customer: a holder of one or more accounts in
a Bank. A customer can consist of one or more
persons or companies. A customer can: make
withdrawals; deposit money; transfer money
between their accounts or to another account;
query their accounts.
Structured Class Description
Class Name: Customer
Description: Personal or company details
Superclass: User
Name: Name
Description: Customer’s name
Type: String (max. 12 chars)
Cardinality: 1
Name: Owns
Description: Details of bank accounts
Type: Account
Cardinality: Many
Structured Class Description
(cont..)
Public Methods:
Name: Pay_bill
Parameters: amount, date, destination,
account.
Description: Customer may pay bills
through the Bank.
Class Diagram
Customer Portfolio Trader
Instrument
Bond Stock
Stock
Option
0..*
0..*
contains
1
1..*
owns handles
1..* 1
Class Diagram Notation
• Depicts static structure of classes.
• Classes represent things in the system.
• Classes may be related in many ways…
– Associated
– Dependant
– Specialised
– Packaged
Object Diagram
Author
Name:String
age:integer
Computer
Name:String
memory:integer
uses
0..1 1..*
Class
Diagram
Brian:Author
Name=“bstone”
age=38
Laptop:Computer
Name=”DellLT”
memory=32 Desktop:Computer
Name=“DellMMX”
memory=32
Object
Diagram

More Related Content

Similar to OODIAGRAMS.ppt

CHAPTER 1 - OVERVIEW OOP.ppt
CHAPTER 1 - OVERVIEW OOP.pptCHAPTER 1 - OVERVIEW OOP.ppt
CHAPTER 1 - OVERVIEW OOP.pptNgoHuuNhan1
 
Unit 1- OOAD ppt
Unit 1- OOAD  pptUnit 1- OOAD  ppt
Unit 1- OOAD pptPRIANKA R
 
ObjectOrientedSystems.ppt
ObjectOrientedSystems.pptObjectOrientedSystems.ppt
ObjectOrientedSystems.pptChishaleFriday
 
3_ObjectOrientedSystems.pptx
3_ObjectOrientedSystems.pptx3_ObjectOrientedSystems.pptx
3_ObjectOrientedSystems.pptxRokaKaram
 
UML Design Document Training Learn UML .pptx
UML Design Document Training Learn UML .pptxUML Design Document Training Learn UML .pptx
UML Design Document Training Learn UML .pptxraghavanp4
 
M03_1_Structur alDiagrams.ppt
M03_1_Structur                         alDiagrams.pptM03_1_Structur                         alDiagrams.ppt
M03_1_Structur alDiagrams.pptnesarahmad37
 
Presentation 4th
Presentation 4thPresentation 4th
Presentation 4thConnex
 
CASE Tools lab.ppt
CASE Tools lab.pptCASE Tools lab.ppt
CASE Tools lab.pptRAJESH S
 
Using class and object java
Using class and object javaUsing class and object java
Using class and object javamha4
 
11 Using classes and objects
11 Using classes and objects11 Using classes and objects
11 Using classes and objectsmaznabili
 
clean architecture uncle bob AnalysisAndDesign.el.en.pptx
clean architecture uncle bob AnalysisAndDesign.el.en.pptxclean architecture uncle bob AnalysisAndDesign.el.en.pptx
clean architecture uncle bob AnalysisAndDesign.el.en.pptxsaber tabatabaee
 

Similar to OODIAGRAMS.ppt (20)

Analysis modeling
Analysis modelingAnalysis modeling
Analysis modeling
 
graph
graphgraph
graph
 
Ooad ch 2
Ooad ch 2Ooad ch 2
Ooad ch 2
 
UML Diagrams
UML DiagramsUML Diagrams
UML Diagrams
 
CHAPTER 1 - OVERVIEW OOP.ppt
CHAPTER 1 - OVERVIEW OOP.pptCHAPTER 1 - OVERVIEW OOP.ppt
CHAPTER 1 - OVERVIEW OOP.ppt
 
Unit 1- OOAD ppt
Unit 1- OOAD  pptUnit 1- OOAD  ppt
Unit 1- OOAD ppt
 
ObjectOrientedSystems.ppt
ObjectOrientedSystems.pptObjectOrientedSystems.ppt
ObjectOrientedSystems.ppt
 
3_ObjectOrientedSystems.pptx
3_ObjectOrientedSystems.pptx3_ObjectOrientedSystems.pptx
3_ObjectOrientedSystems.pptx
 
UML Design Document Training Learn UML .pptx
UML Design Document Training Learn UML .pptxUML Design Document Training Learn UML .pptx
UML Design Document Training Learn UML .pptx
 
M03_1_Structur alDiagrams.ppt
M03_1_Structur                         alDiagrams.pptM03_1_Structur                         alDiagrams.ppt
M03_1_Structur alDiagrams.ppt
 
c++ Unit I.pptx
c++ Unit I.pptxc++ Unit I.pptx
c++ Unit I.pptx
 
Presentation 4th
Presentation 4thPresentation 4th
Presentation 4th
 
CASE Tools lab.ppt
CASE Tools lab.pptCASE Tools lab.ppt
CASE Tools lab.ppt
 
07slide.ppt
07slide.ppt07slide.ppt
07slide.ppt
 
Ooad ch 1_2
Ooad ch 1_2Ooad ch 1_2
Ooad ch 1_2
 
Using class and object java
Using class and object javaUsing class and object java
Using class and object java
 
11 Using classes and objects
11 Using classes and objects11 Using classes and objects
11 Using classes and objects
 
Basics of cpp
Basics of cppBasics of cpp
Basics of cpp
 
clean architecture uncle bob AnalysisAndDesign.el.en.pptx
clean architecture uncle bob AnalysisAndDesign.el.en.pptxclean architecture uncle bob AnalysisAndDesign.el.en.pptx
clean architecture uncle bob AnalysisAndDesign.el.en.pptx
 
ProgrammingPrimerAndOOPS
ProgrammingPrimerAndOOPSProgrammingPrimerAndOOPS
ProgrammingPrimerAndOOPS
 

More from BalasundaramSr

More from BalasundaramSr (20)

WEB 3 IS THE FILE UPLOADED IN THIS APPROACH
WEB 3 IS THE FILE UPLOADED IN THIS APPROACHWEB 3 IS THE FILE UPLOADED IN THIS APPROACH
WEB 3 IS THE FILE UPLOADED IN THIS APPROACH
 
Semantic Search to Web 3.0 Complete Tutorial
Semantic Search to Web 3.0 Complete TutorialSemantic Search to Web 3.0 Complete Tutorial
Semantic Search to Web 3.0 Complete Tutorial
 
Objects and Classes BRIEF.pptx
Objects and Classes BRIEF.pptxObjects and Classes BRIEF.pptx
Objects and Classes BRIEF.pptx
 
SocialCom09-tutorial.pdf
SocialCom09-tutorial.pdfSocialCom09-tutorial.pdf
SocialCom09-tutorial.pdf
 
13047926.ppt
13047926.ppt13047926.ppt
13047926.ppt
 
Xpath.pdf
Xpath.pdfXpath.pdf
Xpath.pdf
 
OSNs.pptx
OSNs.pptxOSNs.pptx
OSNs.pptx
 
HadoopIntroduction.pptx
HadoopIntroduction.pptxHadoopIntroduction.pptx
HadoopIntroduction.pptx
 
HadoopIntroduction.pptx
HadoopIntroduction.pptxHadoopIntroduction.pptx
HadoopIntroduction.pptx
 
Data Mart Lake Ware.pptx
Data Mart Lake Ware.pptxData Mart Lake Ware.pptx
Data Mart Lake Ware.pptx
 
Simple SNA.pdf
Simple SNA.pdfSimple SNA.pdf
Simple SNA.pdf
 
XPATH_XSLT-1.pptx
XPATH_XSLT-1.pptxXPATH_XSLT-1.pptx
XPATH_XSLT-1.pptx
 
Cognitive Science.ppt
Cognitive Science.pptCognitive Science.ppt
Cognitive Science.ppt
 
Web Page Design.ppt
Web Page Design.pptWeb Page Design.ppt
Web Page Design.ppt
 
wipo_res_dev_ge_09_www_130165.ppt
wipo_res_dev_ge_09_www_130165.pptwipo_res_dev_ge_09_www_130165.ppt
wipo_res_dev_ge_09_www_130165.ppt
 
OOA Analysis(1).pdf
OOA Analysis(1).pdfOOA Analysis(1).pdf
OOA Analysis(1).pdf
 
OODIAGRAMS.ppt
OODIAGRAMS.pptOODIAGRAMS.ppt
OODIAGRAMS.ppt
 
Threading.pptx
Threading.pptxThreading.pptx
Threading.pptx
 
OMTanalysis.ppt
OMTanalysis.pptOMTanalysis.ppt
OMTanalysis.ppt
 
network.ppt
network.pptnetwork.ppt
network.ppt
 

Recently uploaded

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
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
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
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
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
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
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfChris Hunter
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterMateoGardella
 

Recently uploaded (20)

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.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
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
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
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
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
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 

OODIAGRAMS.ppt