Académique Documents
Professionnel Documents
Culture Documents
UML is a standard language for specifying, visualizing, constructing, and documenting the artifacts
of software systems.
UML was created by Object Management Group (OMG) and UML 1.0 specification draft was
proposed to the OMG in January 1997.
So UML can be described as a general purpose visual modeling language to visualize, specify,
construct and document software system. Although UML is generally used to model software
systems but it is not limited within this boundary. It is also used to model non software systems as
well like process flow in a manufacturing unit etc.
UML is not a programming language but tools can be used to generate code in various languages
using UML diagrams. UML has a direct relation with object oriented analysis and design. After some
standardization UML is become an OMG (Object Management Group) standard.
UML describes the real time systems. It is used to make a conceptual model. Conceptual model of
UML can be mastered by learning the following three major elements:
• Things
• Relationships
• Diagrams
(1) Things:
Things are the most important building blocks of UML. Things can be:
• Structural
• Behavioral
• Grouping
• Annotational
Structural things:
The Structural things define the static part of the model. They represent physical and conceptual
elements. Following are the brief descriptions of the structural things.
Class:
Collaboration:
Use case:
Use case represents a set of actions performed by a system for a specific goal.
Component:
Node:
Behavioral things:
A behavioral thing consists of the dynamic parts of UML models. Following are the
behavioral things:
State machine is useful when the state of an object in its life cycle is important. It defines the
sequence of states an object goes through in response to events. Events are external factors
responsible for state change.
Grouping things:
Grouping things can be defined as a mechanism to group elements of a UML model together.
There is only one grouping thing available:
Package:
Package is the only one grouping thing available for gathering structural and behavioral things.
Annotational things:
Annotational things can be defined as a mechanism to capture remarks, descriptions, and
comments of UML model elements. Note is the only one Annotational thing available.
Note:
(2) Relationship:
Relationship is another most important building block of UML. It shows how elements are
associated with each other and this association describes the functionality of an application.
Dependency:
Dependency is a relationship between two things in which change in one element also affects the
other one.
Association:
Association is basically a set of links that connects elements of an UML model. It also describes how
many objects are taking part in that relationship.
Generalization:
Realization:
Realization can be defined as a relationship in which two elements are connected. One element
describes some responsibility which is not implemented and the other one implements them. This
relationship exists in case of interfaces.
The visual effect of the UML diagram is the most important part of the entire process. All the other
elements are used to make it a complete one.
UML includes the following nine diagrams and the details are described in the following chapters.
1. Class diagram
2. Object diagram
3. Use case diagram
4. Sequence diagram
5. Collaboration diagram
6. Activity diagram
7. Statechart diagram
8. Deployment diagram
9. Component diagram
Table summarizes the thirteen, up from nine in UML 1.x, diagram types of UML 2.x. In the
diagram column the links will take you to description pages for the artifact. The learning priority
column indicates how important it is for a business application developer to learn the artifact
(IMHO).
CLASS DIAGRAMS
To create and evolve a conceptual class diagram, you need to iteratively model:
• Classes
• Responsibilities
• Associations
• Inheritance relationships
• Composition associations
• Vocabularies
To create and evolve a design class diagram, you need to iteratively model:
• Classes
• Responsibilities
• Associations
• Inheritance relationships
• Composition associations
• Interfaces
Associations
Objects are often associated with, or related to, other objects. For example, Students are
ON WAITING LIST for seminars, professors INSTRUCT seminars, seminars are an
OFFERING OF courses, a professor LIVES AT an address, and so on. Associations are
modeled as lines connecting the two classes whose instances (objects) are involved in the
relationship.
When you model associations in UML class diagrams, you show them as a thin line
connecting two classes. Associations can become quite complex; consequently, you can
depict some things about them on your diagrams. The label, which is optional, although
highly recommended, is typically one or two words describing the association. For
example, professors instruct seminars.
he main purpose of a sequence diagram is to define event sequences that result in some
desired outcome. The focus is less on messages themselves and more on the order in which
messages occur; nevertheless, most sequence diagrams will communicate what messages
are sent between a system's objects as well as the order in which they occur. The diagram
conveys this information along the horizontal and vertical dimensions: the vertical dimension
shows, top down, the time sequence of messages/calls as they occur, and the horizontal
dimension shows, left to right, the object instances that the messages are sent to.
Lifelines
When drawing a sequence diagram, lifeline notation elements are placed across the top of
the diagram. Lifelines represent either roles or object instances that participate in the
sequence being modeled. [Note: In fully modeled systems the objects (instances of classes)
will also be modeled on a system's class diagram.] Lifelines are drawn as a box with a
dashed line descending from the center of the bottom edge (Figure 3). The lifeline's name is
placed inside the box.
Messages
The first message of a sequence diagram always starts at the top and is typically located on
the left side of the diagram for readability. Subsequent messages are then added to the
diagram slightly lower than the previous message.
To show an object (i.e., lifeline) sending a message to another object, you draw a line to the
receiving object with a solid arrowhead (if a synchronous call operation) or with a stick
arrowhead (if an asynchronous signal). The message/method name is placed above the
arrowed line. The message that is being sent to the receiving object represents an
operation/method that the receiving object's class implements.
COLLABORATION DIAGRAM
Instance:
Lollipop Interface:
A lollipop interface is shorthand syntax for an interface. It shows the interface name without
displaying the operations.
Message:
The message indicates communication between objects. The order of messages from top to
bottom on your diagram should be the order in which the messages occur.
COMPONENT DIAGRAM
The component diagram's main purpose is to show the structural relationships between the
components of a system. Components are larger design units that represent things that will
typically be implemented using replaceable" modules.
In component-based development (CBD), component diagrams offer architects a natural
format to begin modeling a solution. Component diagrams allow an architect to verify that a
system's required functionality is being implemented by components, thus ensuring that the
eventual system will be acceptable.
In addition, component diagrams are useful communication tools for various groups. The
diagrams can be presented to key project stakeholders and implementation staff. While
component diagrams are generally geared towards a system's implementation staff,
component diagrams can generally put stakeholders at ease because the diagram presents
an early understanding of the overall system that is being built.
The notation
The component diagram notation set now makes it one of the easiest UML diagrams to
draw. The example shows a relationship between two components: an Order System
component that uses the Inventory System component. As you can see, a component is
drawn as a rectangle with two smaller rectangles protruding from its left side.
ACTIVITY DIAGRAM
Activity diagrams are graphical representations of workflows of stepwise activities and actions
with support for choice, iteration and concurrency. In the Unified Modeling Language, activity
diagrams can be used to describe the business and operational step-by-step workflows of
components in a system. An activity diagram shows the overall flow of control.
Activity diagrams are typically used for business process modeling, for modeling the logic
captured by a single use case or usage scenario, or for modeling the detailed logic of
a business rule.
• Initial node. The filled in circle is the starting point of the diagram. An initial
node isn’t required although it does make it significantly easier to read the
diagram.
• Activity final node. The filled circle with a border is the ending point. An
activity diagram can have zero or more activity final nodes.
• Activity. The rounded rectangles represent activities that occur. An activity may
be physical, such as Inspect Forms, or electronic, such as Display Create Student
Screen.
• Flow/edge. The arrows on the diagram. Although there is a subtle difference
between flows and edges I have never seen a practical purpose for the difference
although I have no doubt one exists. I’ll use the term flow.
• Fork. A black bar with one flow going into it and several leaving it. This
denotes the beginning of parallel activity.
• Join. A black bar with several flows entering it and one leaving it. All flows
going into the join must reach it before processing may continue. This denotes
the end of parallel processing.
DEPLOYMENT DIAGRAM
The deployment diagram shows how the components of the completed system are physically
related (i.e. what hardware will the system be running on and how will it all be connected).
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 State chart diagram describes a state machine. A 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.
Activity diagram is a special kind of a State chart diagram. As State chart diagram defines states it
is used to model lifetime of an object.
Purpose:
State chart diagram is one of the five UML diagrams used to model dynamic nature of a system.
They define different states of an object during its lifetime. And these states are changed by events.
So State chart diagrams are useful to model reactive systems. Reactive systems can be defined as a
system that responds to external or internal events.
Statechart diagram describes the flow of control from one state to another state. States are defined
as a condition in which an object exists and it changes when some event is triggered. So the most
important purpose of Statechart diagram is to model life time of an object from creation to
termination.
Statechart diagrams are also used for forward and reverse engineering of a system. But the main
purpose is to model reactive system.