Uml Cheat Sheet



All cheat sheets, round-ups, quick reference cards, quick reference guides and quick reference sheets in one page. UML - Unified Modeling Language W. You can download freely the PlantUML Language Reference Guide in PDF format.

Please note that you must enable JavaScript if you want larger <code> blocks to be highlighted.

The Unified Modeling Language (UML) includes interaction diagrams with the purpose to illustrate how objects interact via messages. Interaction diagrams are used for dynamic object modelling. There are two common types: sequence and communication diagrams. Communication diagrams illustrate the interactions between objects in terms of sequenced messages. In this blogpost I will provide you with an overview of basic communication diagram notations and common patterns. You should this blogpost as a cheatsheet.

Content

Links

A link is a connection path between to objects—it is an instance of an association. Note that multiple messages and messages in both ways flow along the same—single—link.

Messages

Each message between objects is represented with a message expression and small arrow indicating the direction of the message. The best practise is to not number the starting message. However, even though it is legal to do, it simplifies the overall numbering if you do not do it.

Messages to itself

E&m Cheat Sheet 2017

A message from an object to itself is illustrated by a link to itself, with messages flowing among the link.

Creation of instances

The UML convention is to use a message named `create` to create an instance. It is legal to use another message name. If you do use another message name, you can—and should—annotate the message with a UML stereotype, in this case `«create»`. Furthermore, you may optionally add the UML tagged value `{new}` to the lifeline box to highlight the creation.

Message number sequencing

The order of messages is illustrated with sequence numbers. As stated before, the best practise is to not number the starting message, because you would create another level of number-nesting deeper than otherwise necessary.

The order and nesting of subsequent messages is shown with a legal numbering scheme in which nested messages have a number appended to them. Note that you denote nesting by prepending the incoming message number to the outgoing message number.

Conditional messages

A conditional message is shown by following a sequence number with conditional clause in square brackets. The message is only sent if the clause evaluates to `true`.

Mutually exclusive conditional paths

Uml Cheat Sheet Pdf

UmlWith mutually exclusive conditional paths you must modify the sequence expressions with a conditional letter. By convention, the first letter used is `a`. The figure below states that either `1a` or `1b` could execute after `msg1`. Since either could be the first internal message, both are sequence number 1.

Iteration or looping

Iteration over a collection

Asynchronous calls

Asynchronous calls are shown with a stick arrow; synchronous calls with a filled arrow, see the figure below.

draw.io

Mac apps you need. All of above diagrams, are created with draw.io.

References

Larman, C. (2005). Applying UML and patterns: an introduction to object-oriented analysis and design and the unified proces (3th ed.) (pp. 240-247). Upper Saddle River (New Jersey): Pearson Education, Inc.

Please note that you must enable JavaScript if you want larger <code> blocks to be highlighted.

The Unified Modeling Language (UML) includes interaction diagrams with the purpose to illustrate how objects interact via messages. Interaction diagrams are used for dynamic object modelling. There are two common types: sequence and communication diagrams. Communication diagrams illustrate the interactions between objects in terms of sequenced messages. In this blogpost I will provide you with an overview of basic communication diagram notations and common patterns. You should this blogpost as a cheatsheet.

Content

Links

A link is a connection path between to objects—it is an instance of an association. Note that multiple messages and messages in both ways flow along the same—single—link.

Messages

Each message between objects is represented with a message expression and small arrow indicating the direction of the message. The best practise is to not number the starting message. However, even though it is legal to do, it simplifies the overall numbering if you do not do it.

Messages to itself

A message from an object to itself is illustrated by a link to itself, with messages flowing among the link.

Creation of instances

The UML convention is to use a message named `create` to create an instance. It is legal to use another message name. If you do use another message name, you can—and should—annotate the message with a UML stereotype, in this case `«create»`. Furthermore, you may optionally add the UML tagged value `{new}` to the lifeline box to highlight the creation.

Message number sequencing

The order of messages is illustrated with sequence numbers. As stated before, the best practise is to not number the starting message, because you would create another level of number-nesting deeper than otherwise necessary.

The order and nesting of subsequent messages is shown with a legal numbering scheme in which nested messages have a number appended to them. Note that you denote nesting by prepending the incoming message number to the outgoing message number.

Conditional messages

A conditional message is shown by following a sequence number with conditional clause in square brackets. The message is only sent if the clause evaluates to `true`.

Mutually exclusive conditional paths

E&m cheat sheet 2017With mutually exclusive conditional paths you must modify the sequence expressions with a conditional letter. By convention, the first letter used is `a`. The figure below states that either `1a` or `1b` could execute after `msg1`. Since either could be the first internal message, both are sequence number 1.

Iteration or looping

Plantuml Cheat Sheet

Iteration over a collection

Asynchronous calls

Asynchronous calls are shown with a stick arrow; synchronous calls with a filled arrow, see the figure below.

Uml Cheat Sheet

draw.io

Uml Cheatsheet

All of above diagrams, are created with draw.io.

References

Larman, C. (2005). Applying UML and patterns: an introduction to object-oriented analysis and design and the unified proces (3th ed.) (pp. 240-247). Upper Saddle River (New Jersey): Pearson Education, Inc.