|
Relationships in
UML
By Nishant Kumar
Dependency
Dependency is the relationship between two things in which a change in
one thing may affect the other thing, but not necessarily the reverse.
Graphically, it can be represented as a dashed directed line, directed to the
thing being depended on.
Association
An association is a relationship that connects classes. Example of
association is relationship between person and company. An association is
rendered as solid line.
Adornments of association
Name: You can use Name to specify the nature of association
Role: Each class has specific role that participates in the
relationship. We can specify role to the classes involve in the relationship.
Multiplicity: It represents how many objects may be connected
across an instance of an association.
Aggregation: It implies whole/part relationship where one
class represents larger thing which consists of smaller things.
Generalization
In this type of relationship, the child shares the structure and behavior of
the parent. It is represented as a solid line with a hollow arrowhead pointing
to the parent.
Realization
A realization is a relationship where one class specifies a contract
which another class carries out. This kind of interface can be found out
between the interface and the class.
QUESTION
- What are Relationships in UML?
ANSWER - Dependencies, Generalization, and
Association.
Dependencies -a change in
specification of one thing may affect another thing.
Generalization-class
subclass scenario, one
entity inherits from other.
Associations-a room has
walls, person works for a company.
More UML links
Answer - Model is a simplification of reality, blueprint of the
actual system.....
Answer - We have nine types of diagram in UML.....
Answer - UML breaks the complex system into discrete pieces
that can be understood easily......
|