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

Component

A component is a rectangle with the component icon at its top right and its name inside. The simplest needs only a name.

component Scheduler
Scheduler

Names and aliases

A name with spaces needs quotes. Use as to give it a short alias for references.

component "Memory Allocator" as alloc
component "Page Table" as pages
alloc --> pages
Memory Allocator Page Table

Stereotypes

A stereotype goes in << and >>.

component "Orders DB" as db <<database>>
component "Billing API" as api <<external>>
api --> db
«database» Orders DB «external» Billing API

Nesting

Components can contain components. The outer one becomes a composite.

component "Network Stack" as net {
  component Socket
  component TCP
  component IP
  Socket --> TCP
  TCP --> IP
}
Network Stack Socket TCP IP

Nesting can go several levels deep.

component Kernel {
  component "I/O" as io {
    component VFS
    component Block
    VFS --> Block
  }
  component Memory
  io --> Memory
}
Kernel I/O VFS Block Memory

One-line blocks

A short body can share the line with its braces.

component Sensor { provides ISample }
component Logger { requires ISample }
Sensor Logger ISample

Syntax

component <name> [as <alias>] [<<stereotype>>] [{ ... }]

Specification

UML 2.5.1, 11.6.4 (p. 210). A component is a classifier rectangle; showing the icon lets the «component» keyword be hidden, which drumlin does. In a composite the name is centred, with any keyword above it (9.2.4, p. 101).

Used in

Monolithic kernel, Storage engine, Compiler pipeline.

See also

Component diagrams (how to write the whole diagram), Elements of component diagrams, Grammar.