Sequence diagrams

Used to model interactions between entities in a system in a specific scenario

![](../../../schoolwork/cs2103t/notes/media/Pasted image 20240913182125.png)

Method calls, and method returns

Arrows representing method calls should be solid arrows. Arrows representing method returns should be dashed arrows.

Type of method calls

Synchronous method calls should have filled arrowheads Asynchronous method calls should have lined arrowheads. (out of scope for 2103T)

Notation specifications for activation bar

Activation bar should start at the arrow pointing to it, and end at the line pointing away from it. An activation bar should also be unbroken until method returns.

Object creation

![](../../../schoolwork/cs2103t/notes/media/Pasted image 20240913182430.png)

Object creation

![](../../../schoolwork/cs2103t/notes/media/Pasted image 20240913182528.png)

Object deletion

![](../../../schoolwork/cs2103t/notes/media/Pasted image 20240913182606.png)

For Java, it can be used to indicate when the point ceases to be referenced (garbage-collected).

Self-invocation (of methods)

![](../../../schoolwork/cs2103t/notes/media/Pasted image 20240913182736.png)

Alternative paths

![](../../../schoolwork/cs2103t/notes/media/Pasted image 20240913182814.png)

Optional paths

![](../../../schoolwork/cs2103t/notes/media/Pasted image 20240913182841.png)

Calls to static methods

![](../../../schoolwork/cs2103t/notes/media/Pasted image 20240913182908.png)

Parallel paths

![](../../../schoolwork/cs2103t/notes/media/Pasted image 20240913182927.png)

Reference frames

Allows a segment of the interaction to be omitted and shown as a separate sequence diagram

![](../../../schoolwork/cs2103t/notes/media/Pasted image 20240913182940.png)

Example

![](../../../schoolwork/cs2103t/notes/media/Pasted image 20240913183108.png)