Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Creation and destruction

A created lifeline’s head is drawn at the moment of creation, and the creating message is dashed with an open head. destroy ends a lifeline with an X.

diagram sequence "Worker lifetime"

participant Pool
Pool -> new "Worker" as w : spawn()
Pool ->> w : stop
destroy w
Worker lifetime Pool Worker spawn() stop

Syntax

<a> -> new <name> [as <alias>] [<<stereotype>>] [: label] [{ ... }]
create <name> [as <alias>] [<<stereotype>>] [: label] [{ ... }]    inside a block
destroy <a>

A destroyed lifeline cannot be used afterwards. A destroy in one alt branch leaves the lifeline alive in the others.

Specification

UML 2.5.1. Creation messages: 17.4.4 (p. 577). DestructionOccurrenceSpecification: 17.4.4.2 (p. 578).

Used in

Page fault in a demand-paged kernel.