Sequence Diagram Activity Diagram

Posted on by

Conclusion. Sequence diagrams and activity diagrams provide a graphical notation that can enhance a textual specification (e.g., based on use cases). In RE, system sequence diagrams (SSDs) model the system as a black box and focus on the events generated by actors and how they are handled by the system. Activity diagrams are data/control flow graphs. This article covers the three most commonly used – the activity diagram, sequence diagram, and state machine diagram. Note that the OCUP 2 Foundation level examination covers concurrency only in the activity diagram; concurrency in sequence and state machine diagrams is covered at the Intermediate and Advanced levels. Activity diagram.

UML Examples: Elevator Simulation


The sequence diagram represents the flow of messages in the system and is also termed as an event diagram. It helps in envisioning several dynamic scenarios. It portrays the communication between any two lifelines as a time-ordered sequence of events, such that these lifelines took part at the run time.

Elevator Problem

A product is to be installed to control elevators in a building with m floors. The problem concerns the logic required to move elevators between floors according to the following constraints:

  • Each elevator has a set of m buttons, one for each floor. These illuminate when pressed and cause the elevator to visit the corresponding floor. The illumination is canceled when the elevator visits the corresponding floor.
  • Each floor, except the first floor and top floor has two buttons, one to request and up-elevator and one to request a down-elevator. These buttons illuminate when pressed. The illumination is canceled when an elevator visits the floor and then moves in the desired direction.
  • When an elevator has no requests, it remains at its current floor with its doors closed.

Use Case Diagram

Use case description:

  • A generalized description of how a system will be used.
  • Provides an overview of the intended functionality of the system.
  • Understandable by laymen as well as professionals.

The Use Case Diagram is usually accompanied by a Use Case Detail (or Spec) that takes this format:

Use Case Detail: Overdrawn Report

Used By:
Bank Manager

Details what information flows from the user to the system for this particular Use Case.
theBranchSortCode - The Sort Code of the branch for which the report is required.
theOverdraftPeriod - how long an Account has been overdrawn before it is forms part of the report.

Details what information flows from the system to the external environment, in this case the printer!
overdraftReport (to branchPrinter) - structured as follows: customer name; current overdraft; period overdrawn (days);
Printed for all accounts that have been overdrawn for a period greater than theOverdraftPeriod, and which have not already been reported (on another report) in the last 30 days.

What validity checks or constraints apply on the inputs (or the internal system as a whole, in some cases).
theBranchSortCode - must be a branch sort code held within the system.
theOverdraftPeriod - must be a number between 0 and 100 days.

What changes does the Use Case make to the internal system state.
Updates the reportedOnDate field of overdrawn accounts.

Class Diagram

Sequence Diagram Activity Diagram

Class diagrams show the static structure of the object, their internal structure, and their relationships.

Detailed Class Diagram

State Diagram

A state diagram shows the sequences of states an object goes through during it's life cycle in response to stimuli, together with its responses and actions.

Get All Of Our Templates“I got access to all 1671 Flyer Templates on FlyerHeroes by joining their PRO Subscription”Sometimes we can’t decide which is better – the quality of our Photoshop PSD Flyer Templates or the fact you can access every single one of them from just $19 per month.Our library contains hundreds and hundreds of fully editable Photoshop PSD flyer designs. Women heroes of world war i pdf free download adobe reader. Now that ain’t just awesome, it’s FlyerHeroes awesome. PRO Subscribers can access these designs whenever they want with convenient one-click download.

The design phase should produce detailed class diagrams, collaboration diagrams, sequence diagrams, state diagrams, and activity diagram. However, the elevator problem is too simple for an activity diagram. Thus, we are not using an activity diagram for the elevator problem.

Sequence Diagram

A sequence diagram and collaboration diagram conveys similar information but expressed in different ways. A Sequence diagram shows the explicit sequence of messages suitable for modeling a real-time system, whereas a collobration diagram shows the relationships between objects.

Sequence Diagram for Serving Elevator Button

Sequence Diagram for Serving Door Button

Collaboration Diagram

Activity Diagram To Sequence Diagram

  • Describes the set of interactions between classes or types
  • Shows the relationships among objects

Collabration Digaram for Serving Elevator Button

Sequence Diagram Tool

Collabration Digaram for Serving Door Button