SlideShare a Scribd company logo
Introduction
to UML
Presented By: Arta Iftikhar
Agenda
UML Modeling 2022 2
What will we learn
today?
• Working with Relationships
• Understanding
Aggregations, compositions,
interfaces & Realizations
Acknowledgements
Material for the Lectures are derived from a
variety of sources, including:
• Joseph, Schmuller. "Sams Teach Yourself
UML in 24 Hours."
• Object-Oriented and Classical Software
Engineering, Sixth Edition, WCB/McGraw-Hill,
2005 Stephen R. Schach
• UML resource page http://www.uml.org/
UML Modeling 2022 3
1. Working with
Relationships
Working with
Relationships
A class describes a group of objects with:
 similar properties (attributes).
 Common behavior (operations)
 common relationships to other objects
 and common meaning (“semantics”).
Example:
employee: has a name, employee# and department;
an employee is hired, and fired; an employee works
in one or more projects.
UML Modeling 2022 5
Instances
An instance represents a phenomenon.
The name of an instance is underlined and can contain the class of the
instance.
The attributes are represented with their values.
Uml Modeling 2022 6
zone2price = {
{‘1’, .20},
{‘2’, .40},
{‘3’, .60}}
tarif_1974:TarifSchedule
Types of relationships
Relationships are basically connections between classes to fill out a
picture.
A way to related classes to one another.
Types of Relationships
Associations
Constraints on Associations
Qualified Associations
Reflexive Associations
Inheritance
Generalizations
Dependencies
Uml Modeling 2022 7
Association
When classes are connected conceptually, it’s called association
Associations denote relationships between classes.
Example:
Association between a player and a team.
It can be described as “A player plays on the team”
A filled triangle used to point appropriate direction of the association.
Uml Modeling 2022 8
Association
When one class associates with another, each one usually plays a role
within that association.
You can show each class’s role by writing it near the line next to the
class.
Or
Uml Modeling 2022 9
Constraints on Association
Sometimes an association between 2 classes must follow a rule. That
rule is called Constraint.
It is indicated by putting a constraint near the association line.
Example
A bank teller serves a customer. But each Customer is served in the order
in which he/she appears in the line. That’s a constraint.
Uml Modeling 2022 10
Constraints on Association
Another type of constraint is the (or) relationship. Signified by (or) on a
dashed line that connects 2 association lines.
Example
A high school student choosing either an academic course of study or a
commercial one as shown in figure.
Uml Modeling 2022 11
Association Classes
When an association have attributes and operations, just like a class, It’s
called association class.
It is visualized in the same way as a regular class and a dashed line is
used to connect it to the association line.
Uml Modeling 2022 12
Multiplicity of Association
The number of objects from one class that relate with a single object in
an associated class.
The ability to show how many objects are involved in the association.
One class can relate to another class in many relationships. That are
One-to-one relationship
One-to-many relationship
Many-to-one relationship
Many-to-many relationship
Uml Modeling 2022 13
UML classes and association in MHC-
PMS
UML Modeling 2022 14
Classes and associations in the MHC-PMS
Uml Modeling 2022 15
Qualified
Associatio
n
 A qualified association has a qualifier that is
used to select an object (or objects) from a larger
set of related objects, based upon the qualifier
key. Informally, in a software perspective, it
suggests looking things up by a key, such as
objects in a HashMap.
Example
For example, if a ProductCatalog contains
many ProductDescriptions, and each one can be
selected by an itemID
Uml Modeling 2022 16
Reflexive
Associatio
n
When a class is in an association with itself, it’s
called Reflexive association.
 When a class have object that plays a variety of
roles.
For example, A carOpponent can be either a driver
or a passenger.
Uml Modeling 2022 17
Inheritance
One class can inherit attributes and operations from another class (Super
class).
Uml Modeling 2022 18
An inheritance hierarchy in an animal kingdom
Generalization
Generalization is an everyday technique that we use to manage complexity.
Rather than learn the detailed characteristics of every entity that we experience,
we place these entities in more general classes (animals, cars, houses, etc.) and
learn the characteristics of these classes.
This allows us to infer that different members of these classes have some common
characteristics e.g., squirrels and rats are rodents.
In modeling systems, it is often useful to examine the classes in a system to see if
there is scope for generalization. If changes are proposed, then you do not have to
look at all classes in the system to see if they are affected by the change.
Uml Modeling 2022 19
Generalization
In object-oriented languages, such as Java, generalization is implemented using the
class inheritance mechanisms built into the language.
In a generalization, the attributes and operations associated with higher-level
classes are also associated with the lower-level classes.
 The lower-level classes are subclasses inherit the attributes and operations from
their super classes. These lower-level classes then add more specific attributes and
operations.
Uml Modeling 2022 20
A Generalization Hierarchy
Uml Modeling 2022 21
A generalization hierarchy with added detail
Uml Modeling 2022 22
Dependencies
One class use another class, called dependency.
Represented by a dashed line with an arrowhead.
Uml Modeling 2022 23
Recap…
2. Understanding
Aggregations, compositions,
interfaces & Realizations
Aggregation
A class consists of number of component classes. That special type of
relationship is called Aggregation.
Components and classes are in part-whole association.
Represented by a line between component and the whole with an open
diamond adjoining the whole.
Weak type of association.
Example:
A home computer system is an aggregation that’s consists of a CPU box, a
keyboard, a monitor, a CD-ROM drive, a modem, one-or-more hard drives,
a disk driver, printer and some speakers.
Uml Modeling 2022 26
Aggregation
Computer system as an
aggregation
Uml Modeling 2022 27
The Aggregation Association
Uml Modeling 2022 28
Constraints on Aggregation
Sometimes set of possible components in an aggregation fall into an Or
relationship.
For example, in a restaurant a meal consists of salad or soup along with
main course and desert.
To model such problem, you will use a constraint representing with a
dotted line connecting two part-whole lines.
Uml Modeling 2022 29
Composites
A strong type of aggregation.
Each component can belong to just one whole.
For example, the composites of coffee table are the tabletops and the
legs, makes a composition.
Represented by a line between component and the whole with a filled
diamond.
Uml Modeling 2022 30
Composite
Structure
Diagram
One way to show components of class is
composition. However, if we want to show
internal structure of class, we use
composite structure diagram using
UML2.0
Uml Modeling
2022 31
Composite Structure Diagram
Example:
Suppose you are creating a
model of a shirt.
The composite structure
diagram focuses on the shirt
and its internal structure.
Uml Modeling 2022 32
Interfaces and Realizations
An interface is a set of operations
that specifies some aspect of a
class’s behavior and it’s a set of
operations that a class present to
other classes.
Class rectangle symbol that
contains the keyword «interface».
2022 Uml Modeling 33
Symbol
Interface
Example:
 Every time you use a washing machine,
you don't rip it apart to get to the underlying
circuitry so that you can turn it on and set
the time parameters. You get the washing
machine to perform those operations by
turning a control knob.
 The control knob, an interface to a
washing machine, allows you to get the
washing machine to carry out some of the
washing machine's operations
 Another way to represent a class and an
interface is with a small circle connected by
a line to the class.
Uml Modeling 2022 34
Realization
 The realization is a relationship between two objects, where the
client (one model element) implements the responsibility specified
by the supplier (another model element).
 The realization relationship can be employed in class diagrams
and components diagrams.
 The realization relationship does not have names.
 It is represented by a dashed line with a hollow arrowhead at one
end that points from the client to the server.
Interface Realization
 Interface realization is a kind of specialized relation between the
classifier and the interface. In interface realization relationship,
realizing classifiers conforms to the contract defined by the
interface.
Uml Modeling 2022 35
Inheritance vs Realization
Inheritance
Inheritance is like a relationship
between a parent and a child.
The parent passes on physical
attributes (eye color, hair color,
and so on) to the child, and the
child also takes on behaviors
from the parent
Uml Modeling 2022 36
Realization
 Realization is something like the
relationship between a teacher
and a student
 The teacher doesn't pass on any
physical attributes to the student,
but the student learns behaviors
and procedures from the teacher.
Interfaces Everywhere
A class can realize more than one
interface, and an interface can be realized
by more than one class.
2022 Uml Modeling 37
To model interaction with a class through its
interface, use a dependency symbol.
UML 2.0's "ball-and-socket" notation for modeling
interaction through an elided interface symbol.
Interfaces and ports
A port is an access point that
the mouse plugs into.
Your computer also has a
serial port, a parallel port, and
one or more USB ports.
These ports are the points
through which the computer
interacts with its environment.
In the figure the port symbol
is a small square on the
border of the class icon, and
the square is connected to
the interface.
Uml Modeling 2022 38
Visibility
 Visibility applies to attributes or
operations and specifies the extent to
which other classes can use a given
class's attributes or operations (or an
interface's operations).
Three levels of visibility are possible.
1. At the public level, usability extends
to other classes.
2. At the protected level, usability is
open only to classes that inherit
from the original class.
3. At the private level, only the original
class can use the attribute or
operation.
Uml Modeling 2022 39
Scope
Scope is another concept relevant to attributes and operations and how
they relate across a system.
Two kinds of scope are possible.
1. In instance scope, each instance of a class has its own value for the
attribute or operation.
2. In classifier scope, only one value of the attribute or operation exists
across all instances of the class.
A classifier-scoped attribute or operation appears with its name underlined.
This type of scoping is usually used when a specified group of instances
(and no others) must share the exact values of a private attribute. Instance
scoping is by far the more common type of scope.
Uml Modeling 2022 40
Recap…

More Related Content

Similar to ITSE_11-updated.pptx

UML Design.pptx
UML Design.pptxUML Design.pptx
UML Design.pptx
Md. Nazmus Saqib Khan
 
CS8592-OOAD-UNIT II-STATIC UML DIAGRAMS PPT
CS8592-OOAD-UNIT II-STATIC UML DIAGRAMS PPTCS8592-OOAD-UNIT II-STATIC UML DIAGRAMS PPT
CS8592-OOAD-UNIT II-STATIC UML DIAGRAMS PPT
leela rani
 
Uml unified-modeling-language-presented by dileep
Uml unified-modeling-language-presented by dileepUml unified-modeling-language-presented by dileep
Uml unified-modeling-language-presented by dileep
mekhap
 
Chapter 2.pptx
Chapter 2.pptxChapter 2.pptx
Chapter 2.pptx
RobaDechasa
 
Intro Uml
Intro UmlIntro Uml
Intro Uml
Kris der Rose
 
Ooad lab manual
Ooad  lab manualOoad  lab manual
Ooad lab manual
Praseela R
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
yndaravind
 
Understanding unified modelling language
Understanding unified modelling languageUnderstanding unified modelling language
Understanding unified modelling language
Emmanuel Kumah
 
2 class use case
2 class use case2 class use case
2 class use case
Minal Maniar
 
Unified Modeling Language
Unified Modeling LanguageUnified Modeling Language
Unified Modeling Language
surana college
 
CASE Tools lab.ppt
CASE Tools lab.pptCASE Tools lab.ppt
CASE Tools lab.ppt
RAJESH S
 
Fundamentals of Software Engineering
Fundamentals of Software Engineering Fundamentals of Software Engineering
Fundamentals of Software Engineering
Madhar Khan Pathan
 
OOP_Module 2.pptx
OOP_Module 2.pptxOOP_Module 2.pptx
OOP_Module 2.pptx
PrasenjitKumarDas2
 
Introduction to Object orientation , Modeling as a Design Technique Modeling ...
Introduction to Object orientation , Modeling as a Design Technique Modeling ...Introduction to Object orientation , Modeling as a Design Technique Modeling ...
Introduction to Object orientation , Modeling as a Design Technique Modeling ...
DhwaniDesai21
 
Software architecture
Software architectureSoftware architecture
Software architecture
Inam Soomro
 
Ooad static diagram
Ooad static diagramOoad static diagram
Ooad static diagram
TSubashiniAPIICSE
 
A&D - UML
A&D - UMLA&D - UML
A&D - UML
vinay arora
 
Architecture and design
Architecture and designArchitecture and design
Architecture and design
himanshu_airon
 
08 class and sequence diagrams
08   class and sequence diagrams08   class and sequence diagrams
08 class and sequence diagrams
kebsterz
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
Sudarsun Santhiappan
 

Similar to ITSE_11-updated.pptx (20)

UML Design.pptx
UML Design.pptxUML Design.pptx
UML Design.pptx
 
CS8592-OOAD-UNIT II-STATIC UML DIAGRAMS PPT
CS8592-OOAD-UNIT II-STATIC UML DIAGRAMS PPTCS8592-OOAD-UNIT II-STATIC UML DIAGRAMS PPT
CS8592-OOAD-UNIT II-STATIC UML DIAGRAMS PPT
 
Uml unified-modeling-language-presented by dileep
Uml unified-modeling-language-presented by dileepUml unified-modeling-language-presented by dileep
Uml unified-modeling-language-presented by dileep
 
Chapter 2.pptx
Chapter 2.pptxChapter 2.pptx
Chapter 2.pptx
 
Intro Uml
Intro UmlIntro Uml
Intro Uml
 
Ooad lab manual
Ooad  lab manualOoad  lab manual
Ooad lab manual
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
Understanding unified modelling language
Understanding unified modelling languageUnderstanding unified modelling language
Understanding unified modelling language
 
2 class use case
2 class use case2 class use case
2 class use case
 
Unified Modeling Language
Unified Modeling LanguageUnified Modeling Language
Unified Modeling Language
 
CASE Tools lab.ppt
CASE Tools lab.pptCASE Tools lab.ppt
CASE Tools lab.ppt
 
Fundamentals of Software Engineering
Fundamentals of Software Engineering Fundamentals of Software Engineering
Fundamentals of Software Engineering
 
OOP_Module 2.pptx
OOP_Module 2.pptxOOP_Module 2.pptx
OOP_Module 2.pptx
 
Introduction to Object orientation , Modeling as a Design Technique Modeling ...
Introduction to Object orientation , Modeling as a Design Technique Modeling ...Introduction to Object orientation , Modeling as a Design Technique Modeling ...
Introduction to Object orientation , Modeling as a Design Technique Modeling ...
 
Software architecture
Software architectureSoftware architecture
Software architecture
 
Ooad static diagram
Ooad static diagramOoad static diagram
Ooad static diagram
 
A&D - UML
A&D - UMLA&D - UML
A&D - UML
 
Architecture and design
Architecture and designArchitecture and design
Architecture and design
 
08 class and sequence diagrams
08   class and sequence diagrams08   class and sequence diagrams
08 class and sequence diagrams
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented Design
 

Recently uploaded

一比一原版(QU毕业证)皇后大学毕业证如何办理
一比一原版(QU毕业证)皇后大学毕业证如何办理一比一原版(QU毕业证)皇后大学毕业证如何办理
一比一原版(QU毕业证)皇后大学毕业证如何办理
8p28uk6g
 
Impact of Effective Performance Appraisal Systems on Employee Motivation and ...
Impact of Effective Performance Appraisal Systems on Employee Motivation and ...Impact of Effective Performance Appraisal Systems on Employee Motivation and ...
Impact of Effective Performance Appraisal Systems on Employee Motivation and ...
Dr. Nazrul Islam
 
Risk-Management-presentation for cooperatives
Risk-Management-presentation for cooperativesRisk-Management-presentation for cooperatives
Risk-Management-presentation for cooperatives
bernanbumatay1
 
Designing and Sustaining Large-Scale Value-Centered Agile Ecosystems (powered...
Designing and Sustaining Large-Scale Value-Centered Agile Ecosystems (powered...Designing and Sustaining Large-Scale Value-Centered Agile Ecosystems (powered...
Designing and Sustaining Large-Scale Value-Centered Agile Ecosystems (powered...
Alexey Krivitsky
 
Conflict resololution,role of hr in resolution
Conflict resololution,role of hr in resolutionConflict resololution,role of hr in resolution
Conflict resololution,role of hr in resolution
Dr. Christine Ngari ,Ph.D (HRM)
 
Sethurathnam Ravi: A Legacy in Finance and Leadership
Sethurathnam Ravi: A Legacy in Finance and LeadershipSethurathnam Ravi: A Legacy in Finance and Leadership
Sethurathnam Ravi: A Legacy in Finance and Leadership
Anjana Josie
 
Chart--Time Management.pdf How to time is spent
Chart--Time Management.pdf How to time is spentChart--Time Management.pdf How to time is spent
Chart--Time Management.pdf How to time is spent
spandane
 
Enriching engagement with ethical review processes
Enriching engagement with ethical review processesEnriching engagement with ethical review processes
Enriching engagement with ethical review processes
strikingabalance
 
Team Building and TUCKMANS MODEL Explained
Team Building and TUCKMANS MODEL ExplainedTeam Building and TUCKMANS MODEL Explained
Team Building and TUCKMANS MODEL Explained
iampriyanshujaiswal
 
12 steps to transform your organization into the agile org you deserve
12 steps to transform your organization into the agile org you deserve12 steps to transform your organization into the agile org you deserve
12 steps to transform your organization into the agile org you deserve
Pierre E. NEIS
 
Resource-mobilization-guide-for-community-based-organizations1.pdf
Resource-mobilization-guide-for-community-based-organizations1.pdfResource-mobilization-guide-for-community-based-organizations1.pdf
Resource-mobilization-guide-for-community-based-organizations1.pdf
FeteneA
 
Comparing Stability and Sustainability in Agile Systems
Comparing Stability and Sustainability in Agile SystemsComparing Stability and Sustainability in Agile Systems
Comparing Stability and Sustainability in Agile Systems
Rob Healy
 
Ganpati Kumar Choudhary Indian Ethos PPT.pptx
Ganpati Kumar Choudhary Indian Ethos PPT.pptxGanpati Kumar Choudhary Indian Ethos PPT.pptx
Ganpati Kumar Choudhary Indian Ethos PPT.pptx
GanpatiKumarChoudhar
 
Employment Practices Regulation and Multinational Corporations
Employment PracticesRegulation and Multinational CorporationsEmployment PracticesRegulation and Multinational Corporations
Employment Practices Regulation and Multinational Corporations
RoopaTemkar
 
Credit-Management seminar for cooperative power point presentation
Credit-Management seminar for cooperative power point presentationCredit-Management seminar for cooperative power point presentation
Credit-Management seminar for cooperative power point presentation
bernanbumatay1
 
Colby Hobson: Residential Construction Leader Building a Solid Reputation Thr...
Colby Hobson: Residential Construction Leader Building a Solid Reputation Thr...Colby Hobson: Residential Construction Leader Building a Solid Reputation Thr...
Colby Hobson: Residential Construction Leader Building a Solid Reputation Thr...
dsnow9802
 
20240608 QFM019 Engineering Leadership Reading List May 2024
20240608 QFM019 Engineering Leadership Reading List May 202420240608 QFM019 Engineering Leadership Reading List May 2024
20240608 QFM019 Engineering Leadership Reading List May 2024
Matthew Sinclair
 
Strategy for E-Types - Strategy Formulation.pptx
Strategy for E-Types - Strategy Formulation.pptxStrategy for E-Types - Strategy Formulation.pptx
Strategy for E-Types - Strategy Formulation.pptx
KarthikRaghu8
 
Addiction to Winning Across Diverse Populations.pdf
Addiction to Winning Across Diverse Populations.pdfAddiction to Winning Across Diverse Populations.pdf
Addiction to Winning Across Diverse Populations.pdf
Bill641377
 
Myrna Story of Leadership and Management
Myrna Story of Leadership and ManagementMyrna Story of Leadership and Management
Myrna Story of Leadership and Management
Waleed Kamal
 

Recently uploaded (20)

一比一原版(QU毕业证)皇后大学毕业证如何办理
一比一原版(QU毕业证)皇后大学毕业证如何办理一比一原版(QU毕业证)皇后大学毕业证如何办理
一比一原版(QU毕业证)皇后大学毕业证如何办理
 
Impact of Effective Performance Appraisal Systems on Employee Motivation and ...
Impact of Effective Performance Appraisal Systems on Employee Motivation and ...Impact of Effective Performance Appraisal Systems on Employee Motivation and ...
Impact of Effective Performance Appraisal Systems on Employee Motivation and ...
 
Risk-Management-presentation for cooperatives
Risk-Management-presentation for cooperativesRisk-Management-presentation for cooperatives
Risk-Management-presentation for cooperatives
 
Designing and Sustaining Large-Scale Value-Centered Agile Ecosystems (powered...
Designing and Sustaining Large-Scale Value-Centered Agile Ecosystems (powered...Designing and Sustaining Large-Scale Value-Centered Agile Ecosystems (powered...
Designing and Sustaining Large-Scale Value-Centered Agile Ecosystems (powered...
 
Conflict resololution,role of hr in resolution
Conflict resololution,role of hr in resolutionConflict resololution,role of hr in resolution
Conflict resololution,role of hr in resolution
 
Sethurathnam Ravi: A Legacy in Finance and Leadership
Sethurathnam Ravi: A Legacy in Finance and LeadershipSethurathnam Ravi: A Legacy in Finance and Leadership
Sethurathnam Ravi: A Legacy in Finance and Leadership
 
Chart--Time Management.pdf How to time is spent
Chart--Time Management.pdf How to time is spentChart--Time Management.pdf How to time is spent
Chart--Time Management.pdf How to time is spent
 
Enriching engagement with ethical review processes
Enriching engagement with ethical review processesEnriching engagement with ethical review processes
Enriching engagement with ethical review processes
 
Team Building and TUCKMANS MODEL Explained
Team Building and TUCKMANS MODEL ExplainedTeam Building and TUCKMANS MODEL Explained
Team Building and TUCKMANS MODEL Explained
 
12 steps to transform your organization into the agile org you deserve
12 steps to transform your organization into the agile org you deserve12 steps to transform your organization into the agile org you deserve
12 steps to transform your organization into the agile org you deserve
 
Resource-mobilization-guide-for-community-based-organizations1.pdf
Resource-mobilization-guide-for-community-based-organizations1.pdfResource-mobilization-guide-for-community-based-organizations1.pdf
Resource-mobilization-guide-for-community-based-organizations1.pdf
 
Comparing Stability and Sustainability in Agile Systems
Comparing Stability and Sustainability in Agile SystemsComparing Stability and Sustainability in Agile Systems
Comparing Stability and Sustainability in Agile Systems
 
Ganpati Kumar Choudhary Indian Ethos PPT.pptx
Ganpati Kumar Choudhary Indian Ethos PPT.pptxGanpati Kumar Choudhary Indian Ethos PPT.pptx
Ganpati Kumar Choudhary Indian Ethos PPT.pptx
 
Employment Practices Regulation and Multinational Corporations
Employment PracticesRegulation and Multinational CorporationsEmployment PracticesRegulation and Multinational Corporations
Employment Practices Regulation and Multinational Corporations
 
Credit-Management seminar for cooperative power point presentation
Credit-Management seminar for cooperative power point presentationCredit-Management seminar for cooperative power point presentation
Credit-Management seminar for cooperative power point presentation
 
Colby Hobson: Residential Construction Leader Building a Solid Reputation Thr...
Colby Hobson: Residential Construction Leader Building a Solid Reputation Thr...Colby Hobson: Residential Construction Leader Building a Solid Reputation Thr...
Colby Hobson: Residential Construction Leader Building a Solid Reputation Thr...
 
20240608 QFM019 Engineering Leadership Reading List May 2024
20240608 QFM019 Engineering Leadership Reading List May 202420240608 QFM019 Engineering Leadership Reading List May 2024
20240608 QFM019 Engineering Leadership Reading List May 2024
 
Strategy for E-Types - Strategy Formulation.pptx
Strategy for E-Types - Strategy Formulation.pptxStrategy for E-Types - Strategy Formulation.pptx
Strategy for E-Types - Strategy Formulation.pptx
 
Addiction to Winning Across Diverse Populations.pdf
Addiction to Winning Across Diverse Populations.pdfAddiction to Winning Across Diverse Populations.pdf
Addiction to Winning Across Diverse Populations.pdf
 
Myrna Story of Leadership and Management
Myrna Story of Leadership and ManagementMyrna Story of Leadership and Management
Myrna Story of Leadership and Management
 

ITSE_11-updated.pptx

  • 2. Agenda UML Modeling 2022 2 What will we learn today? • Working with Relationships • Understanding Aggregations, compositions, interfaces & Realizations
  • 3. Acknowledgements Material for the Lectures are derived from a variety of sources, including: • Joseph, Schmuller. "Sams Teach Yourself UML in 24 Hours." • Object-Oriented and Classical Software Engineering, Sixth Edition, WCB/McGraw-Hill, 2005 Stephen R. Schach • UML resource page http://www.uml.org/ UML Modeling 2022 3
  • 5. Working with Relationships A class describes a group of objects with:  similar properties (attributes).  Common behavior (operations)  common relationships to other objects  and common meaning (“semantics”). Example: employee: has a name, employee# and department; an employee is hired, and fired; an employee works in one or more projects. UML Modeling 2022 5
  • 6. Instances An instance represents a phenomenon. The name of an instance is underlined and can contain the class of the instance. The attributes are represented with their values. Uml Modeling 2022 6 zone2price = { {‘1’, .20}, {‘2’, .40}, {‘3’, .60}} tarif_1974:TarifSchedule
  • 7. Types of relationships Relationships are basically connections between classes to fill out a picture. A way to related classes to one another. Types of Relationships Associations Constraints on Associations Qualified Associations Reflexive Associations Inheritance Generalizations Dependencies Uml Modeling 2022 7
  • 8. Association When classes are connected conceptually, it’s called association Associations denote relationships between classes. Example: Association between a player and a team. It can be described as “A player plays on the team” A filled triangle used to point appropriate direction of the association. Uml Modeling 2022 8
  • 9. Association When one class associates with another, each one usually plays a role within that association. You can show each class’s role by writing it near the line next to the class. Or Uml Modeling 2022 9
  • 10. Constraints on Association Sometimes an association between 2 classes must follow a rule. That rule is called Constraint. It is indicated by putting a constraint near the association line. Example A bank teller serves a customer. But each Customer is served in the order in which he/she appears in the line. That’s a constraint. Uml Modeling 2022 10
  • 11. Constraints on Association Another type of constraint is the (or) relationship. Signified by (or) on a dashed line that connects 2 association lines. Example A high school student choosing either an academic course of study or a commercial one as shown in figure. Uml Modeling 2022 11
  • 12. Association Classes When an association have attributes and operations, just like a class, It’s called association class. It is visualized in the same way as a regular class and a dashed line is used to connect it to the association line. Uml Modeling 2022 12
  • 13. Multiplicity of Association The number of objects from one class that relate with a single object in an associated class. The ability to show how many objects are involved in the association. One class can relate to another class in many relationships. That are One-to-one relationship One-to-many relationship Many-to-one relationship Many-to-many relationship Uml Modeling 2022 13
  • 14. UML classes and association in MHC- PMS UML Modeling 2022 14
  • 15. Classes and associations in the MHC-PMS Uml Modeling 2022 15
  • 16. Qualified Associatio n  A qualified association has a qualifier that is used to select an object (or objects) from a larger set of related objects, based upon the qualifier key. Informally, in a software perspective, it suggests looking things up by a key, such as objects in a HashMap. Example For example, if a ProductCatalog contains many ProductDescriptions, and each one can be selected by an itemID Uml Modeling 2022 16
  • 17. Reflexive Associatio n When a class is in an association with itself, it’s called Reflexive association.  When a class have object that plays a variety of roles. For example, A carOpponent can be either a driver or a passenger. Uml Modeling 2022 17
  • 18. Inheritance One class can inherit attributes and operations from another class (Super class). Uml Modeling 2022 18 An inheritance hierarchy in an animal kingdom
  • 19. Generalization Generalization is an everyday technique that we use to manage complexity. Rather than learn the detailed characteristics of every entity that we experience, we place these entities in more general classes (animals, cars, houses, etc.) and learn the characteristics of these classes. This allows us to infer that different members of these classes have some common characteristics e.g., squirrels and rats are rodents. In modeling systems, it is often useful to examine the classes in a system to see if there is scope for generalization. If changes are proposed, then you do not have to look at all classes in the system to see if they are affected by the change. Uml Modeling 2022 19
  • 20. Generalization In object-oriented languages, such as Java, generalization is implemented using the class inheritance mechanisms built into the language. In a generalization, the attributes and operations associated with higher-level classes are also associated with the lower-level classes.  The lower-level classes are subclasses inherit the attributes and operations from their super classes. These lower-level classes then add more specific attributes and operations. Uml Modeling 2022 20
  • 21. A Generalization Hierarchy Uml Modeling 2022 21
  • 22. A generalization hierarchy with added detail Uml Modeling 2022 22
  • 23. Dependencies One class use another class, called dependency. Represented by a dashed line with an arrowhead. Uml Modeling 2022 23
  • 26. Aggregation A class consists of number of component classes. That special type of relationship is called Aggregation. Components and classes are in part-whole association. Represented by a line between component and the whole with an open diamond adjoining the whole. Weak type of association. Example: A home computer system is an aggregation that’s consists of a CPU box, a keyboard, a monitor, a CD-ROM drive, a modem, one-or-more hard drives, a disk driver, printer and some speakers. Uml Modeling 2022 26
  • 27. Aggregation Computer system as an aggregation Uml Modeling 2022 27
  • 29. Constraints on Aggregation Sometimes set of possible components in an aggregation fall into an Or relationship. For example, in a restaurant a meal consists of salad or soup along with main course and desert. To model such problem, you will use a constraint representing with a dotted line connecting two part-whole lines. Uml Modeling 2022 29
  • 30. Composites A strong type of aggregation. Each component can belong to just one whole. For example, the composites of coffee table are the tabletops and the legs, makes a composition. Represented by a line between component and the whole with a filled diamond. Uml Modeling 2022 30
  • 31. Composite Structure Diagram One way to show components of class is composition. However, if we want to show internal structure of class, we use composite structure diagram using UML2.0 Uml Modeling 2022 31
  • 32. Composite Structure Diagram Example: Suppose you are creating a model of a shirt. The composite structure diagram focuses on the shirt and its internal structure. Uml Modeling 2022 32
  • 33. Interfaces and Realizations An interface is a set of operations that specifies some aspect of a class’s behavior and it’s a set of operations that a class present to other classes. Class rectangle symbol that contains the keyword «interface». 2022 Uml Modeling 33 Symbol
  • 34. Interface Example:  Every time you use a washing machine, you don't rip it apart to get to the underlying circuitry so that you can turn it on and set the time parameters. You get the washing machine to perform those operations by turning a control knob.  The control knob, an interface to a washing machine, allows you to get the washing machine to carry out some of the washing machine's operations  Another way to represent a class and an interface is with a small circle connected by a line to the class. Uml Modeling 2022 34
  • 35. Realization  The realization is a relationship between two objects, where the client (one model element) implements the responsibility specified by the supplier (another model element).  The realization relationship can be employed in class diagrams and components diagrams.  The realization relationship does not have names.  It is represented by a dashed line with a hollow arrowhead at one end that points from the client to the server. Interface Realization  Interface realization is a kind of specialized relation between the classifier and the interface. In interface realization relationship, realizing classifiers conforms to the contract defined by the interface. Uml Modeling 2022 35
  • 36. Inheritance vs Realization Inheritance Inheritance is like a relationship between a parent and a child. The parent passes on physical attributes (eye color, hair color, and so on) to the child, and the child also takes on behaviors from the parent Uml Modeling 2022 36 Realization  Realization is something like the relationship between a teacher and a student  The teacher doesn't pass on any physical attributes to the student, but the student learns behaviors and procedures from the teacher.
  • 37. Interfaces Everywhere A class can realize more than one interface, and an interface can be realized by more than one class. 2022 Uml Modeling 37 To model interaction with a class through its interface, use a dependency symbol. UML 2.0's "ball-and-socket" notation for modeling interaction through an elided interface symbol.
  • 38. Interfaces and ports A port is an access point that the mouse plugs into. Your computer also has a serial port, a parallel port, and one or more USB ports. These ports are the points through which the computer interacts with its environment. In the figure the port symbol is a small square on the border of the class icon, and the square is connected to the interface. Uml Modeling 2022 38
  • 39. Visibility  Visibility applies to attributes or operations and specifies the extent to which other classes can use a given class's attributes or operations (or an interface's operations). Three levels of visibility are possible. 1. At the public level, usability extends to other classes. 2. At the protected level, usability is open only to classes that inherit from the original class. 3. At the private level, only the original class can use the attribute or operation. Uml Modeling 2022 39
  • 40. Scope Scope is another concept relevant to attributes and operations and how they relate across a system. Two kinds of scope are possible. 1. In instance scope, each instance of a class has its own value for the attribute or operation. 2. In classifier scope, only one value of the attribute or operation exists across all instances of the class. A classifier-scoped attribute or operation appears with its name underlined. This type of scoping is usually used when a specified group of instances (and no others) must share the exact values of a private attribute. Instance scoping is by far the more common type of scope. Uml Modeling 2022 40

Editor's Notes

  1. Complex associations example
  2. Links example
  3. How to represent. Many to many: For example, a many-to-many relationship exists between customers and products: customers can purchase various products, and products can be purchased by many customers.
  4. Class scope: Static members