SlideShare a Scribd company logo
1 of 41
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

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 PPTleela 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 dileepmekhap
 
Ooad lab manual
Ooad  lab manualOoad  lab manual
Ooad lab manualPraseela R
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UMLyndaravind
 
Understanding unified modelling language
Understanding unified modelling languageUnderstanding unified modelling language
Understanding unified modelling languageEmmanuel Kumah
 
Unified Modeling Language
Unified Modeling LanguageUnified Modeling Language
Unified Modeling Languagesurana college
 
CASE Tools lab.ppt
CASE Tools lab.pptCASE Tools lab.ppt
CASE Tools lab.pptRAJESH S
 
Fundamentals of Software Engineering
Fundamentals of Software Engineering Fundamentals of Software Engineering
Fundamentals of Software Engineering Madhar Khan Pathan
 
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 architectureInam Soomro
 
Architecture and design
Architecture and designArchitecture and design
Architecture and designhimanshu_airon
 
08 class and sequence diagrams
08   class and sequence diagrams08   class and sequence diagrams
08 class and sequence diagramskebsterz
 
Object Oriented Design
Object Oriented DesignObject Oriented Design
Object Oriented DesignAravinth NSP
 

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

Call Now Pooja Mehta : 7738631006 Door Step Call Girls Rate 100% Satisfactio...
Call Now Pooja Mehta :  7738631006 Door Step Call Girls Rate 100% Satisfactio...Call Now Pooja Mehta :  7738631006 Door Step Call Girls Rate 100% Satisfactio...
Call Now Pooja Mehta : 7738631006 Door Step Call Girls Rate 100% Satisfactio...Pooja Nehwal
 
BDSM⚡Call Girls in Sector 99 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 99 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 99 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 99 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
operational plan ppt.pptx nursing management
operational plan ppt.pptx nursing managementoperational plan ppt.pptx nursing management
operational plan ppt.pptx nursing managementTulsiDhidhi1
 
CALL ON ➥8923113531 🔝Call Girls Charbagh Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Charbagh Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Charbagh Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Charbagh Lucknow best sexual serviceanilsa9823
 
Construction Project Management | Coursera 2024
Construction Project Management | Coursera 2024Construction Project Management | Coursera 2024
Construction Project Management | Coursera 2024Alex Marques
 
GENUINE Babe,Call Girls IN Baderpur Delhi | +91-8377087607
GENUINE Babe,Call Girls IN Baderpur  Delhi | +91-8377087607GENUINE Babe,Call Girls IN Baderpur  Delhi | +91-8377087607
GENUINE Babe,Call Girls IN Baderpur Delhi | +91-8377087607dollysharma2066
 
Day 0- Bootcamp Roadmap for PLC Bootcamp
Day 0- Bootcamp Roadmap for PLC BootcampDay 0- Bootcamp Roadmap for PLC Bootcamp
Day 0- Bootcamp Roadmap for PLC BootcampPLCLeadershipDevelop
 
internal analysis on strategic management
internal analysis on strategic managementinternal analysis on strategic management
internal analysis on strategic managementharfimakarim
 
Agile Coaching Change Management Framework.pptx
Agile Coaching Change Management Framework.pptxAgile Coaching Change Management Framework.pptx
Agile Coaching Change Management Framework.pptxalinstan901
 
Dealing with Poor Performance - get the full picture from 3C Performance Mana...
Dealing with Poor Performance - get the full picture from 3C Performance Mana...Dealing with Poor Performance - get the full picture from 3C Performance Mana...
Dealing with Poor Performance - get the full picture from 3C Performance Mana...Hedda Bird
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Ameerpet high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls Ameerpet high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls Ameerpet high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls Ameerpet high-profile Call Girladitipandeya
 

Recently uploaded (20)

Call Now Pooja Mehta : 7738631006 Door Step Call Girls Rate 100% Satisfactio...
Call Now Pooja Mehta :  7738631006 Door Step Call Girls Rate 100% Satisfactio...Call Now Pooja Mehta :  7738631006 Door Step Call Girls Rate 100% Satisfactio...
Call Now Pooja Mehta : 7738631006 Door Step Call Girls Rate 100% Satisfactio...
 
BDSM⚡Call Girls in Sector 99 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 99 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 99 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 99 Noida Escorts >༒8448380779 Escort Service
 
operational plan ppt.pptx nursing management
operational plan ppt.pptx nursing managementoperational plan ppt.pptx nursing management
operational plan ppt.pptx nursing management
 
CALL ON ➥8923113531 🔝Call Girls Charbagh Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Charbagh Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Charbagh Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Charbagh Lucknow best sexual service
 
Construction Project Management | Coursera 2024
Construction Project Management | Coursera 2024Construction Project Management | Coursera 2024
Construction Project Management | Coursera 2024
 
GENUINE Babe,Call Girls IN Baderpur Delhi | +91-8377087607
GENUINE Babe,Call Girls IN Baderpur  Delhi | +91-8377087607GENUINE Babe,Call Girls IN Baderpur  Delhi | +91-8377087607
GENUINE Babe,Call Girls IN Baderpur Delhi | +91-8377087607
 
Rohini Sector 16 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 16 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 16 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 16 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Discover -CQ Master Class - Rikita Wadhwa.pdf
Discover -CQ Master Class - Rikita Wadhwa.pdfDiscover -CQ Master Class - Rikita Wadhwa.pdf
Discover -CQ Master Class - Rikita Wadhwa.pdf
 
Unlocking the Future - Dr Max Blumberg, Founder of Blumberg Partnership
Unlocking the Future - Dr Max Blumberg, Founder of Blumberg PartnershipUnlocking the Future - Dr Max Blumberg, Founder of Blumberg Partnership
Unlocking the Future - Dr Max Blumberg, Founder of Blumberg Partnership
 
Day 0- Bootcamp Roadmap for PLC Bootcamp
Day 0- Bootcamp Roadmap for PLC BootcampDay 0- Bootcamp Roadmap for PLC Bootcamp
Day 0- Bootcamp Roadmap for PLC Bootcamp
 
Disrupt or be Disrupted - Kirk Vallis.pdf
Disrupt or be Disrupted - Kirk Vallis.pdfDisrupt or be Disrupted - Kirk Vallis.pdf
Disrupt or be Disrupted - Kirk Vallis.pdf
 
internal analysis on strategic management
internal analysis on strategic managementinternal analysis on strategic management
internal analysis on strategic management
 
Peak Performance & Resilience - Dr Dorian Dugmore
Peak Performance & Resilience - Dr Dorian DugmorePeak Performance & Resilience - Dr Dorian Dugmore
Peak Performance & Resilience - Dr Dorian Dugmore
 
Agile Coaching Change Management Framework.pptx
Agile Coaching Change Management Framework.pptxAgile Coaching Change Management Framework.pptx
Agile Coaching Change Management Framework.pptx
 
Imagine - HR; are handling the 'bad banter' - Stella Chandler.pdf
Imagine - HR; are handling the 'bad banter' - Stella Chandler.pdfImagine - HR; are handling the 'bad banter' - Stella Chandler.pdf
Imagine - HR; are handling the 'bad banter' - Stella Chandler.pdf
 
Dealing with Poor Performance - get the full picture from 3C Performance Mana...
Dealing with Poor Performance - get the full picture from 3C Performance Mana...Dealing with Poor Performance - get the full picture from 3C Performance Mana...
Dealing with Poor Performance - get the full picture from 3C Performance Mana...
 
Imagine - Creating Healthy Workplaces - Anthony Montgomery.pdf
Imagine - Creating Healthy Workplaces - Anthony Montgomery.pdfImagine - Creating Healthy Workplaces - Anthony Montgomery.pdf
Imagine - Creating Healthy Workplaces - Anthony Montgomery.pdf
 
VIP 7001035870 Find & Meet Hyderabad Call Girls Ameerpet high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls Ameerpet high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls Ameerpet high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls Ameerpet high-profile Call Girl
 
Becoming an Inclusive Leader - Bernadette Thompson
Becoming an Inclusive Leader - Bernadette ThompsonBecoming an Inclusive Leader - Bernadette Thompson
Becoming an Inclusive Leader - Bernadette Thompson
 
Intro_University_Ranking_Introduction.pptx
Intro_University_Ranking_Introduction.pptxIntro_University_Ranking_Introduction.pptx
Intro_University_Ranking_Introduction.pptx
 

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