|
Samples Index |
Next Diagram >>
The sequence diagram in figure 1
represents an elaboration for the 'Student Registers for Class' use case
in an automated student registration system. (Click
here to see the diagram without the horizontal dotted guidelines.)
Figure 1 - Automated Registration System sample
sequence diagram

The boxes at the top of the
sequence diagram constitute the diagram header and represent the components or
units of the system.
Sequence diagram editor supports four types
of header elements (see the full list
of supported sequence diagram elements):
-
Actors - Actors represent a person or
other external entity that interacts with the system.
-
Objects - Objects are used to represent
object instances in an object-oriented programming language such
as Java or C++.
-
Units - Units are used to represent logical
entities in the system such as components, servers, threads and
tasks that may or may not be implemented using objects. They can
also be used to distinguish objects from classes.
-
Separators - Separators do not interact
with the diagram but rather represent a boundary between header
elements.
Sequence diagram header elements can be grouped together
(see
group elements) into components or subsystems to illustrate the
logical layering of the system. In Figure 1,
the web server components are grouped together into the Web Server group
to indicate that these elements are part of the Web Server.
Separator elements can be used to
show boundaries between the components of the sequence diagram (such
as the air interface between cell phone and base station, or the Internet
in a distributed or web-based application).
The body of the sequence diagram
shows the interactions between the various units as they collaborate
to accomplish a particular purpose. The dotted horizontal lines are
called guidelines, which are typically used with their corresponding
line numbers to refer to portions of the diagram in documentation or
during design meetings (Sequence Diagram Editor allows you to
configure whether or not to display these guidelines and/or line numbers
in your sequence diagrams.)
Messages are by far the most
common elements and are used to model the interactions and interfaces
between components.
Sequence diagram editor supports six different
types of message elements:
-
Simple Messages - Simple messages can be used to represent
interactions between components that are not direct method calls
(could be IPC, remoting, http or web services)
-
Asynchronous Messages - Asynchronous messages represent stimuli
that can occur at any time based on external events (e.g. interrupts/sensors
or user input)
-
Call Messages - Call messages are usually reserved for method
calls between objects in the same thread/task where the calling
object waits for the return from the recipient before continuing
-
Return Messages - Return messages indicate a response to
a call message, although they can also be used with simple messages
to represent request/response pairs.
-
Create Messages - Create messages are used to represent the
dynamic creation of an object instance. They can also be used to
represent the creation of a thread or task.
-
Destroy Messages - Destroy messages are used to represent
the dynamic destruction of an object instance. They can also be
used to represent the shutdown of a thread or task.
Action elements can be used
to represent an action or processing performed by a single entity without
involving other units. In the sequence diagram example above, the Registration
Page entity renders the page in line 16 using an action.
State elements are useful
for units representing a state machine to describe state transitions
that occur as a result of sending a messages or some other event. Sates
for different header elements can be configured to share the same guideline.
Timer elements can be used
to show the start, stop or expiration of a timer associated with a particular
header element. They are used extensively in state machine design to
handle error conditions when communicating with external systems.
Diagram links represent a
complex action performed by multiple header elements without showing
all the details. For example, the "user login" box (line 7) in the sequence
diagram typically involves interactions between the all the components.
The details can be elaborated and shown in a separate sequence diagram
with a link from the current diagram. Using diagram links to abstract
details that are not specific or relevant to the current scenario reduces
the size and clutter of the diagrams and enhances maintainability (used
like a function call in a programming language.)
Blocks are useful for representing
simple alternation or looping constructs for a given header element.
For example, in the sequence diagram of Figure 1
the student may not have to go through the login process if they are
already logged into the system (line 6-7).
If there are significant differences
between the alternatives in the sequence diagram, using scenario elements
like scenario start, scenario case, and scenario end rather
than blocks may be more appropriate as illustrated in
figure 2 (lines 22-29). You can always use additional
sequence diagrams to describe different scenarios if it would be more
clear.
 This sequence diagram shows the two
alternative scenarios (course full found line 22, and No Service Found
line 26) in the same diagram. Notice also that
Sequence Diagram Editor
automatically takes care of pagination by repeating the diagram title
and header elements for each page.
Documentation notes and Flow Notes
are used throughout the sequence diagram to add additional descriptive
text. These can be selectively hidden or displayed based on the desired
detail level. Free Notes can also be used to add detail or annotations.
See the
full list of diagram elements supported by
Sequence Diagram Editor.
Sequence Diagram Editor
can also export diagrams in PDF (click
here) and RTF (click here)
formats. The PDF and RTF exports can optionally include
documentation notes for the sequence diagram provided as a separate table at the
end of the export.
NOTE: while the exported RTF document tends to be
large, opening this document with Microsoft Word and saving it as
a Word document considerably reduces the size of the files (sometimes by
a factor of 20 or more.) Click
here for the corresponding Word document.
Download
Sequence Diagram Editor for a Risk Free 14-day Trial |