8/28/2021
62

Thanks also to the js-sequence-diagram project for usage of the grammar for the sequence diagrams. Thanks to Jessica Peter for inspiration and starting point for gantt rendering. Mermaid was created by Knut Sveidqvist for easier documentation. Roles of the actors in the system can be depicted. Use Case Diagram: 4.4 Collaboration Diagram Collaboration diagrams remains analogous with the sequence diagrams since Diagrams encompasses various objects, links along with transmission or receiving of Messages in this way they coordinate to structural aspects of system.(which also provides.

Sequence Diagram: Sequence diagrams typically show the flow of functionality through a use case, and consist of the following components: 1. Actors, involved in the functionality 2. Objects, that a system needs to provide the functionality. UML Sequence diagrams are a dynamic modeling technique, as are collaboration diagrams and activity diagrams. UML sequence diagrams are typically used to. Validate and flesh out the logic of a usage scenario. A usage scenario is exactly what its name indicates - the description of a potential way that your system is used.

A use case diagramis 'a diagram that shows the relationshipsamong actors and use cases within a system. 'Use case diagrams are often used to:

  • Provide an overview of all or part of the usage requirements for a system or organization in the form of an essential model or a business model
  • Communicate the scope of a development project
  • Model your analysis of your usage requirements in the form of a system use case model>

A use case model is comprised of one or more use case diagrams and anysupporting documentation such as use case specifications and actor definitions. Within most use case models the use case specifications tend to be the primaryartifact with use case diagrams filling a supporting role as the 'glue' thatkeeps your requirements model together. Use case models should bedeveloped from the point of view of your project stakeholders and not from the(often technical) point of view of developers. There are guidelines for:

1. Use Cases

A use case describes a sequence of actions that provide ameasurable value to an actor. A usecase is drawn as a horizontal ellipse on a UML use case diagram, as you see in Figure 1.

  1. Use Case Names Begin With a Strong Verb
  2. Name Use Cases Using Domain Terminology
  3. Place Your Primary Use Cases In The Top-Left Corner Of The Diagram
  4. Imply Timing Considerations By Stacking Use Cases. As you see in Figure1, the use cases that typically occur first are shown above those that appearlater.

Figure 1. Implying timing considerations between usecases.


2. Actors

An actor is a person, organization, or external system thatplays a role in one or more interactions with your system (actors are typically drawn asstick figures on UML Use Case diagrams).

Figure 2. Online shopping.

  1. Place Your Primary Actor(S) In The Top-Left Corner Of The Diagram
  2. Draw Actors To The Outside Of A Use Case Diagram
  3. Name Actors With Singular, Business-Relevant Nouns
  4. Associate Each Actor With One Or More Use Cases
  5. Actors Model Roles, Not Positions
  6. Use <> to Indicate System Actors
  7. Actors Don’t Interact With One Another
  8. Introduce an Actor Called 'Time' to Initiate Scheduled Events

3. Relationships

There are several types of relationships that may appear ona use case diagram:

  • An association between an actor and a use case
  • An association between two use cases
  • A generalization between two actors
  • A generalization between two use cases

Associations are depicted as lines connecting two modelingelements with an optional open-headed arrowhead on one end of the lineindicating the direction of the initial invocation of the relationship.Generalizations are depicted as a close-headed arrow with the arrow pointingtowards the more general modeling element.

Figure 3. Enrolling students in a university.


Sequence Diagram Generator

  1. Indicate An Association Between An Actor And A Use Case If The ActorAppears Within The Use Case Logic
  2. Avoid Arrowheads On Actor-Use Case Relationships
  3. Apply <> When You Know Exactly When To Invoke TheUse Case
  4. Apply <> When A Use Case May Be Invoked AcrossSeveral Use Case Steps
  5. Introduce <> associations sparingly
  6. Generalize Use Cases When a Single Condition Results In Significantly NewBusiness Logic
  7. Do Not Apply <>, <>, or<>
  8. Avoid More Than Two Levels Of Use Case Associations
  9. Place An Included Use Case To The Right Of The Invoking Use Case
  10. Place An Extending Use Case Below The Parent Use Case
  11. Apply the 'Is Like' Rule to Use Case Generalization
  12. Place an Inheriting Use Case Below The Base Use Case
  13. Apply the 'Is Like' Rule to Actor Inheritance
  14. Place an Inheriting Actor Below the Parent Actor

4. System Boundary Boxes

The rectangle around the use cases is called the systemboundary box and as the name suggests it indicates the scope of your system -the use cases inside the rectangle represent the functionality that you intendto implement.

  1. Indicate Release Scope with a System Boundary Box. In Figure 2 you see that three system boundary boxes areincluded, each of which has a label indicating which release the various usecases have been assigned to.
  2. Avoid Meaningless System Boundary Boxes.

Sequence Diagrams

A sequence diagram is a form of interaction diagram which shows objects as lifelines running down the page, with their interactions over time represented as messages drawn as arrows from the source lifeline to the target lifeline. Sequence diagrams are good at showing which objects communicate with which other objects; and what messages trigger those communications. Sequence diagrams are not intended for showing complex procedural logic.


Lifelines

A lifeline represents an individual participant in a sequence diagram. A lifeline will usually have a rectangle containing its object name. If its name is 'self', that indicates that the lifeline represents the classifier which owns the sequence diagram.

Sometimes a sequence diagram will have a lifeline with an actor element symbol at its head. This will usually be the case if the sequence diagram is owned by a use case. Boundary, control and entity elements from robustness diagrams can also own lifelines.


Messages

Messages are displayed as arrows. Messages can be complete, lost or found; synchronous or asynchronous; call or signal. In the following diagram, the first message is a synchronous message (denoted by the solid arrowhead) complete with an implicit return message; the second message is asynchronous (denoted by line arrowhead), and the third is the asynchronous return message (denoted by the dashed line).


Execution Occurrence

A thin rectangle running down the lifeline denotes the execution occurrence, or activation of a focus of control. In the previous diagram, there are three execution occurrences. The first is the source object sending two messages and receiving two replies; the second is the target object receiving a synchronous message and returning a reply; and the third is the target object receiving an asynchronous message and returning a reply.


Self Message

A self message can represent a recursive call of an operation, or one method calling another method belonging to the same object. It is shown as creating a nested focus of control in the lifeline’s execution occurrence.


Lost and Found Messages

Lost messages are those that are either sent but do not arrive at the intended recipient, or which go to a recipient not shown on the current diagram. Found messages are those that arrive from an unknown sender, or from a sender not shown on the current diagram. They are denoted going to or coming from an endpoint element.


Lifeline Start and End

A lifeline may be created or destroyed during the timescale represented by a sequence diagram. In the latter case, the lifeline is terminated by a stop symbol, represented as a cross. In the former case, the symbol at the head of the lifeline is shown at a lower level down the page than the symbol of the object that caused the creation. The following diagram shows an object being created and destroyed.


Duration and Time Constraints

What is your ip addresses. By default, a message is shown as a horizontal line. Since the lifeline represents the passage of time down the screen, when modelling a real-time system, or even a time-bound business process, it can be important to consider the length of time it takes to perform actions. By setting a duration constraint for a message, the message will be shown as a sloping line.


Combined Fragments

It was stated earlier that sequence diagrams are not intended for showing complex procedural logic. While this is the case, there are a number of mechanisms that do allow for adding a degree of procedural logic to diagrams and which come under the heading of combined fragments. A combined fragment is one or more processing sequence enclosed in a frame and executed under specific named circumstances. The fragments available are:
  • Alternative fragment (denoted “alt”) models if…then…else constructs.
  • Option fragment (denoted “opt”) models switch constructs.
  • Break fragment models an alternative sequence of events that is processed instead of the whole of the rest of the diagram.
  • Parallel fragment (denoted “par”) models concurrent processing.
  • Weak sequencing fragment (denoted “seq”) encloses a number of sequences for which all the messages must be processed in a preceding segment before the following segment can start, but which does not impose any sequencing within a segment on messages that don’t share a lifeline.
  • Strict sequencing fragment (denoted “strict”) encloses a series of messages which must be processed in the given order.
  • Negative fragment (denoted “neg”) encloses an invalid series of messages.
  • Critical fragment encloses a critical section.
  • Ignore fragment declares a message or message to be of no interest if it appears in the current context.
  • Consider fragment is in effect the opposite of the ignore fragment: any message not included in the consider fragment should be ignored.
  • Assertion fragment (denoted “assert”) designates that any sequence not shown as an operand of the assertion is invalid.
  • Loop fragment encloses a series of messages which are repeated.
The following diagram shows a loop fragment.

Project Sequence Diagram

There is also an interaction occurrence, which is similar to a combined fragment. An interaction occurrence is a reference to another diagram which has the word 'ref' in the top left corner of the frame, and has the name of the referenced diagram shown in the middle of the frame.


Gate

A gate is a connection point for connecting a message inside a fragment with a message outside a fragment. EA shows a gate as a small square on a fragment frame. Diagram gates act as off-page connectors for sequence diagrams, representing the source of incoming messages or the target of outgoing messages. The following two diagrams show how they might be used in practice. Note that the gate on the top level diagram is the point at which the message arrowhead touches the reference fragment - there is no need to render it as a box shape.

Sequence diagram with 2 actors

Part Decomposition

An object can have more than one lifeline coming from it. This allows for inter- and intra-object messages to be displayed on the same diagram.


Sequence Diagram Editor

State Invariant / Continuations

Sequence Diagram With 2 Actors

A state invariant is a constraint placed on a lifeline that must be true at run-time. It is shown as a rectangle with semi-circular ends.

Sequence Diagram Tool

A continuation has the same notation as a state invariant, but is used in combined fragments and can stretch across more than one lifeline.