This site is from a past semester! The current version will be here when the new semester starts.

Week 12 [Fri, Oct 29th] - Topics

Detailed Table of Contents



Guidance for the item(s) below:

As with the class/object diagrams, let us refresh our memory of the sequence diagrams notations that you learned in TIC2002.

[W12.1] Sequence Diagrams: Basics

W12.1a :

Design → Modelling → Modelling Behaviors Sequence diagrams - basic

Video

Can draw basic sequence diagrams

Sequence diagrams model the interactions between various entities in a system, in a specific scenario. Modelling such scenarios is useful, for example, to verify the design of the internal interactions is able to provide the expected outcomes.

Some examples where a sequence diagram can be used:

To model how components of a system interact with each other to respond to a user action.

To model how objects inside a component interact with each other to respond to a method call it received from another component.

UML Sequence Diagrams → Introduction


UML Sequence Diagrams → Basic Notation


UML Sequence Diagrams → Loops


UML Sequence Diagrams → Object Creation


UML Sequence Diagrams → Minimal Notation


Exercises

Explain Sequence Diagram about Machine


Draw a Sequence Diagram for the code (PersonList, Person, Tag)


Find notation errors in Sequence Diagram





Follow up notes for the item(s) above:

Now that you know the basic notations for the sequence diagrams, here is a worked example of drawing sequence diagrams (basic notation) to match a code snippet.

Video Sequence diagrams (basic) - Item creation

Guidance for the item(s) below:

Earlier, you learned the basic syntax used in sequence diagrams. Now, let's learn some intermediate syntax.

[W12.2] Sequence Diagrams: Intermediate

W12.2a :

Design → Modelling → Modelling Behaviors Sequence diagrams - intermediate

Video

Can draw intermediate-level sequence diagrams

UML Sequence Diagrams → Object Deletion


UML Sequence Diagrams → Self-Invocation


UML Sequence Diagrams → Alternative Paths


UML Sequence Diagrams → Optional Paths


UML Sequence Diagrams → Calls to Static Methods


Exercises

What’s going on here?


Explain Sequence Diagram (ParserFactory)


Draw Sequence Diagram for printing a quote




W12.2b :

Tools → UML → Sequence Diagrams → Parallel paths

Can interpret sequence diagrams with parallel paths

UML uses par frames to indicate parallel paths.

Notation:

Logic is calling methods CloudServer#poll() and LocalServer#poll() in parallel.

If you show parallel paths in a sequence diagram, the corresponding Java implementation is likely to be multi-threaded because a normal Java program cannot do multiple things at the same time.


W12.2c :

Tools → UML → Sequence Diagrams → Reference frames

Can interpret sequence diagrams with reference frames

UML uses ref frame to allow a segment of the interaction to be omitted and shown as a separate sequence diagram. Reference frames help you to break complicated sequence diagrams into multiple parts or simply to omit details you are not interested in showing.

Notation:

The details of the get minefield appearance interactions have been omitted from the diagram.

Those details are shown in a separate sequence diagram given below.



Follow up notes for the item(s) above:

Here is a worked example of drawing sequence diagrams (intermediate notation) to match a code snippet.

Video Drawing sequence diagrams (intermediate) - TaskList#generateTask()

Video Drawing sequence diagrams (intermediate) - create Quote