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

PPTX
class diagram
PPTX
Ch.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptx
PPTX
unified modelling language(UML) diagrams
PPTX
Structural modeling and analysis
PPT
Basic Class Diagrams in fundamental computing.ppt
PPT
Department of Computer science and engineering
PPT
Basic Class Diagrams in software engineering
PPT
8 oo approach&uml-23_feb
class diagram
Ch.03 - Class Diagram_1 OBJECT ORIENTED ANALYSIS AND DESIGN [O] .pptx
unified modelling language(UML) diagrams
Structural modeling and analysis
Basic Class Diagrams in fundamental computing.ppt
Department of Computer science and engineering
Basic Class Diagrams in software engineering
8 oo approach&uml-23_feb

Similar to OODIAGRAMS (4).ppt (20)

PPT
Software Engineering Lec5 oop-uml-i
PPTX
Software Engineering and Project Management - Introduction, Modeling Concepts...
PPTX
Unit two concept of classes and objects
PPT
Ooad ch 2
PPT
07. Class Diagram.ppt
PPTX
Basic structural modelling in unified modelling language
PPT
Ooad ch 1_2
PDF
Object oriented programming interview questions
PPTX
OOSD1-unit1_1_16_09.pptx
DOCX
Object oriented basics
PPT
uml2-1214558329929112-8.ppt
PPTX
CHAP1 - OBJECT ORIENTED PROGRAMMING.pptx
PPT
Chapter 02 The Object Model_Software E.ppt
DOCX
Ooad notes
PPTX
PPT
Lecture13 abap on line
PPT
Lecture12 software design class diagram
PPTX
Requirements modeling
PDF
Lecture 2 cst 205-281 oop
Software Engineering Lec5 oop-uml-i
Software Engineering and Project Management - Introduction, Modeling Concepts...
Unit two concept of classes and objects
Ooad ch 2
07. Class Diagram.ppt
Basic structural modelling in unified modelling language
Ooad ch 1_2
Object oriented programming interview questions
OOSD1-unit1_1_16_09.pptx
Object oriented basics
uml2-1214558329929112-8.ppt
CHAP1 - OBJECT ORIENTED PROGRAMMING.pptx
Chapter 02 The Object Model_Software E.ppt
Ooad notes
Lecture13 abap on line
Lecture12 software design class diagram
Requirements modeling
Lecture 2 cst 205-281 oop
Ad

More from BalasundaramSr (20)

PPTX
An overview IoT Platform 2024 07082024.pptx
PDF
About IoT Protocols and Security Techniques
PDF
IoT Overview IP6 Diagrams IPv^ Given with Details
PDF
socialnetworkanalysis-100225055227-phpapp02.pdf
PDF
WEB 3 IS THE FILE UPLOADED IN THIS APPROACH
PDF
Semantic Search to Web 3.0 Complete Tutorial
PPTX
Objects and Classes BRIEF.pptx
PDF
SocialCom09-tutorial.pdf
PPT
13047926.ppt
PDF
Xpath.pdf
PPTX
OSNs.pptx
PPTX
HadoopIntroduction.pptx
PPTX
HadoopIntroduction.pptx
PPTX
Data Mart Lake Ware.pptx
PDF
Simple SNA.pdf
PPTX
XPATH_XSLT-1.pptx
PPT
Cognitive Science.ppt
PPT
Web Page Design.ppt
PPT
wipo_res_dev_ge_09_www_130165.ppt
PDF
OOA Analysis(1).pdf
An overview IoT Platform 2024 07082024.pptx
About IoT Protocols and Security Techniques
IoT Overview IP6 Diagrams IPv^ Given with Details
socialnetworkanalysis-100225055227-phpapp02.pdf
WEB 3 IS THE FILE UPLOADED IN THIS APPROACH
Semantic Search to Web 3.0 Complete Tutorial
Objects and Classes BRIEF.pptx
SocialCom09-tutorial.pdf
13047926.ppt
Xpath.pdf
OSNs.pptx
HadoopIntroduction.pptx
HadoopIntroduction.pptx
Data Mart Lake Ware.pptx
Simple SNA.pdf
XPATH_XSLT-1.pptx
Cognitive Science.ppt
Web Page Design.ppt
wipo_res_dev_ge_09_www_130165.ppt
OOA Analysis(1).pdf
Ad

Recently uploaded (20)

PDF
IP : I ; Unit I : Preformulation Studies
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PPTX
What’s under the hood: Parsing standardized learning content for AI
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PDF
Journal of Dental Science - UDMY (2020).pdf
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
PPTX
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
PDF
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
PPTX
Core Concepts of Personalized Learning and Virtual Learning Environments
PDF
Environmental Education MCQ BD2EE - Share Source.pdf
DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PDF
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 2).pdf
PDF
Empowerment Technology for Senior High School Guide
PDF
Journal of Dental Science - UDMY (2021).pdf
PDF
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PDF
Complications of Minimal Access-Surgery.pdf
PDF
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
PDF
Skin Care and Cosmetic Ingredients Dictionary ( PDFDrive ).pdf
IP : I ; Unit I : Preformulation Studies
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
What’s under the hood: Parsing standardized learning content for AI
Share_Module_2_Power_conflict_and_negotiation.pptx
Journal of Dental Science - UDMY (2020).pdf
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
1.3 FINAL REVISED K-10 PE and Health CG 2023 Grades 4-10 (1).pdf
Core Concepts of Personalized Learning and Virtual Learning Environments
Environmental Education MCQ BD2EE - Share Source.pdf
Cambridge-Practice-Tests-for-IELTS-12.docx
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
BP 505 T. PHARMACEUTICAL JURISPRUDENCE (UNIT 2).pdf
Empowerment Technology for Senior High School Guide
Journal of Dental Science - UDMY (2021).pdf
David L Page_DCI Research Study Journey_how Methodology can inform one's prac...
B.Sc. DS Unit 2 Software Engineering.pptx
Complications of Minimal Access-Surgery.pdf
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
Skin Care and Cosmetic Ingredients Dictionary ( PDFDrive ).pdf

OODIAGRAMS (4).ppt