[go: up one dir, main page]

0% found this document useful (0 votes)
4 views47 pages

Relationships in UML

UML

Uploaded by

Sahil Mali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views47 pages

Relationships in UML

UML

Uploaded by

Sahil Mali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 47

Relationships in UML

Relationships provides a pathway for communication


among objects. it is another connection between
things. When we model a system, we are supposed to
not only identify the things that form a system, but we
should also model how these things are related to one
another.
Relationships show how elements are associated with
each other and this association (link) describes the
functionality of an application.
Primary types of relationships are :-

• Dependency (Uses)
• Association (define relation)
• Generalization (inheritance, ‘is a’)
Dependency
Is a unidirectional usage of relationships
between elements. It is a using relationship.
Therefore change in specification of one class
affect another class that uses it, but not
necessary the reverse. Graphically, a
dependency is rendered as a dashed directed
line, directed to the thing being depend on.

Class A Class B
Class A dependent on Class B
Treatment Lab result

Treatment depends on lab result


Association
An association is a bi-directional, structural relationship that
specifies that objects of one thing are connected to objects of
another. They can be traversed in both directions, with different
conditions. The direction implied by the name is the forward
direction, the opposite direction is the inverse direction. A role
represents purpose / capacity where in one class is associated
with another class.
Adornments of association
• Name
• Role
• Multiplicity
• Aggregation
Name :- An association can have a name , and you use
that name to describe the nature of relationship. So
that there is no ambiguity about it meaning, you can
give a direction to the name by providing a directional
triangle that point in the direction you intend to read
the name.
Role :- When a class participates in an association, it
has a specific role that it plays in that relationship. The
role is part of association, not part of class.
Aggregation
It is a simple concept which distinguish a “whole” from a
“part”. Where one class represents a larger thing
(whole), which consists of smaller things (parts). This
kind of relationship is called aggregation which
represents ‘has a’ relationship, meaning that an object
of the whole has objects of the part. Aggregation is just
a special kind of association and is specified by adoring a
plain association with an ‘open diamond’ at the whole
end.
Company Whole

Aggregation

Department Part
Classroom

Blackboard Bench Door


Multiplicity
Composition
Is a form of aggregation with strong ownership to represent the
component of a complex object. It is denoted by a solid diamond
at the end of the path
Car

Engine Wheel Door


Light

Composition Of A Car
School Department

Student
Generalization
Account

Current Account Savings Account


Interface

You might also like