UML(Unified Modelling Language)
- The elements are like components which can be associated in different ways
to make a complete UML pictures which is known as diagram. So it is very
important to understand the different diagrams to implement the knowledge in
real life systems.
- Any complex system is best understood by making some kind of diagrams or
pictures. These diagrams have a better impact on our understanding. So if we
look around then we will realize that the diagrams are not a new concept but it
is used widely in different form in different industries.
- We prepare UML diagrams to understand a system in better and simple way. A
single diagram is not enough to cover all aspects of the system. So UML defines
various kinds of diagrams to cover most of the aspects of a system.
- You can also create your own set of diagrams to meet your requirements.
Diagrams are generally made in an incremental and iterative way.
There are two broad caetgories of diagrams and then are again divided into
sub-categories:
·
Structural Diagrams
·
Behavioral Diagrams
Structural Diagrams:
The structural
diagrams represent the static aspect of the system. These static aspects
represent those parts of a diagram which forms the main structure and therefore
stable.
These
static parts are represents by classes, interfaces, objects, components and
nodes. The four structural diagrams are:
Behavioral Diagrams:
Any system
can have two aspects, static and dynamic. So a model is considered as complete
when both the aspects are covered fully.
Behavioral
diagrams basically capture the dynamic aspect of a system. Dynamic aspect can
be further described as the changing/moving parts of a system.
UML has
the following five types of behavioral diagrams:
- Use case diagram
- Sequence diagram
- Collaboration diagram
- Statechart diagram
- Activity diagram
Class
Diagram:
Overview:
The class diagram is a static diagram. It represents the static view of an
application. Class diagram is not only used for visualizing, describing and
documenting different aspects of a system but also for constructing executable
code of the software application.
The class diagram describes the attributes and operations of a class and
also the constraints imposed on the system. The class diagrams are widely used
in the modelling of object oriented systems because they are the only UML
diagrams which can be mapped directly with object oriented languages.
The class diagram shows a collection of classes, interfaces, associations,
collaborations and constraints. It is also known as a
structural diagram.
Purpose:
So the purpose of the class diagram can be summarized as:
·
Analysis and design of the static view of an
application.
·
Describe responsibilities of a system.
·
Base for component and deployment diagrams.
·
Forward and reverse engineering.
Use Case
Diagram:
Overview:
To model a system the most important aspect is to capture the dynamic
behaviour. To clarify a bit in details,
dynamic behaviour means the
behaviour of the system when it is running /operating.
So only static behaviour is not sufficient to model a system rather dynamic
behaviour is more important than static behaviour. Use case diagram is dynamic
in nature there should be some internal or external factors for making the
interaction.
These internal and external agents are known as actors. So use case diagrams
are consists of actors, use cases and their relationships. The diagram is used
to model the system/subsystem of an application. A single use case diagram
captures a particular functionality of a system.
Purpose:
So in brief, the purposes of use case diagrams can be as follows:
·
Used to gather requirements of a system.
·
Used to get an outside view of a system.
·
Identify external and internal factors
influencing the system.
·
Show the interacting among the requirements are
actors.
Sequence
Diagram:
Overview:
From the name
Interaction it is clear that the diagram is used to
describe some type of interactions among the different elements in the model.
So this interaction is a part of dynamic behaviour of the system.
This interactive behaviour is represented in UML by two diagrams known as
Sequence
diagram and
Collaboration diagram. The basic purposes of both the
diagrams are similar.
Sequence diagram emphasizes on time sequence of messages and collaboration
diagram emphasizes on the structural organization of the objects that send and
receive messages.
Purpose:
So the purposes of interaction diagram can be describes as:
·
To capture dynamic behaviour of a system.
·
To describe the message flow in the system.
·
To describe structural organization of the
objects.
·
To describe interaction among objects.
Collaboration
Diagram:
Overview:
The second interaction diagram is collaboration diagram. It shows the object
organization as shown below. Here in collaboration diagram the method call
sequence is indicated by some numbering technique as shown below. The number
indicates how the methods are called one after another. We have taken the same
order management system to describe the collaboration diagram.
The method calls are similar to that of a sequence diagram. But the
difference is that the sequence diagram does not describe the object
organization where as the collaboration diagram shows the object organization.
State
Diagram:
Overview:
The name of the diagram itself clarifies the purpose of the diagram and
other details. It describes different states of a component in a system. The
states are specific to a component/object of a system.
A Statechart diagram describes a state machine. Now to clarify it state machine
can be defined as a machine which defines different states of an object and
these states are controlled by external or internal events.
Purpose:
Following are the main purposes of using Statechart diagrams:
·
To model dynamic aspect of a system.
·
To model life time of a reactive system.
·
To describe different states of an object during
its life time.
·
Define a state machine to model states of an
object.
Activity
Diagram:
Overview:
Activity diagram is another important diagram in UML to describe dynamic aspects
of the system.
Activity diagram is basically a flow chart to represent the flow form one
activity to another activity. The activity can be described as an operation of
the system.
So the control flow is drawn from one operation to another. This flow can be
sequential, branched or concurrent. Activity diagrams deals with all type of
flow control by using different elements like fork, join etc.
Purpose:
So the purposes can be described as:
·
Draw the activity flow of a system.
·
Describe the sequence from one activity to
another.
·
Describe the parallel, branched and concurrent
flow of the system.