00 UML

Updated 4 Oct 2026

📐 CSS323 — Chapter 4: UML Diagrams Cheat Sheet


1. UML Diagram Taxonomy

UML Diagrams
├── Structure Diagrams
│   ├── Class
│   ├── Object
│   ├── Package
│   ├── Component          ← covered in this chapter
│   ├── Composite Structure
│   └── Deployment         ← covered in this chapter
├── Behavior Diagrams
│   ├── Use Case
│   ├── Activity           ← covered in this chapter (most detail)
│   ├── State Machine      ← covered in this chapter
│   └── Interaction
│       ├── Sequence
│       ├── Communication
│       ├── Interaction Overview
│       └── Timing
└── UML Extension
    └── Profile Diagram

🔵 PART I — Activity Diagrams


2. What Is an Activity Diagram?

Specifies system behavior — shows how data and control flow through a process.

  • Based on data flow models — a directed graph showing how data moves through a system
  • Think of it as a flowchart on steroids: shows steps AND what data flows between them

🍎 Apple analogy: The "Share Photo" feature in iOS — Activity Diagram shows: tap Share → pick recipient → compress image → send → notify sent. Each step with data flowing between them.


3. Three Node Types (memorize these!)

Node TypeShapePurposeExample
Action NodeRounded rectangleExecutable step — does one thing"Compress Image"
Control NodeVarious (see below)Coordinates flowDecision, Fork, Join
Object NodeRectangleHolds data temporarily between actionsOrder [Pending]

4. Control Nodes — All 6 Types

Control NodeShapeBehaviorKey Rule
Initial● filled circleStarts the flowMultiple initials → multiple parallel flows; one token per outgoing edge (no duplication)
Decision◇ diamondRoutes to ONE outgoing edge based on guardGuards on edges; [else] = fallback if all others fail; token NOT duplicated
Merge◇ diamondBrings multiple alternate flows togetherNo synchronization — passes immediately; does NOT wait
Fork━━ thick barSplits ONE flow into MULTIPLE parallel flowsTokens ARE duplicated
Join━━ thick barWaits for ALL incoming flows, then continuesSynchronizes — must wait; can have {joinSpec}
Final — Activity⊙ circle-in-circleTerminates when FIRST token arrivesKills everything — intentional race
Final — Flow⊗ circle-with-XTerminates only THIS branchJust destroys tokens that arrive; others continue

Decision vs. Merge — Easy Confusion ⚠️

Decision = one IN, many OUT   (splits based on condition)
Merge    = many IN, one OUT   (combines alternate paths, no waiting)
Fork     = one IN, many OUT   (creates parallel flows, duplicates tokens)
Join     = many IN, one OUT   (synchronizes parallel flows, WAITS)

🍎 Apple analogy:

  • Decision: if photoSize > 10MB → compress vs. send directly
  • Fork: simultaneously upload to iCloud AND send notification
  • Join: wait for BOTH face detection AND location tagging to complete before saving
  • Merge: whether user paid by card OR Apple Pay, both paths → "Show Receipt"

5. Edges — Two Types

Edge TypeWhat FlowsUsage
Control Flow EdgeControl tokenStarts next action after previous completes — plain arrow
Object Flow EdgeObject/data tokenPasses data between object nodes — arrow with rectangle

Edge Weight:

weight=n⇒minimum n tokens must traverse simultaneously\boxed{\text{weight} = n \Rightarrow \text{minimum } n \text{ tokens must traverse simultaneously}}

Example: Form Cricket Team {weight=11} — must have 11 players before the action fires.


6. Actions

The fundamental unit of executable functionality. Does one transformation.

  • Creating objects
  • Setting attribute values
  • Linking objects together
  • Invoking behaviors

Pins (inputs/outputs of actions):

Pin TypeDescription
Regular PinInput waits until action starts; output waits until passed downstream
Streaming {STREAM}Accepts/provides values WHILE action is executing
Exception Output △Triangle symbol — fires when action terminates with error; excludes all other outputs
Parameter SetsAction accepts input from ONE set OR another, not both
ValuePinProvides constant values to an action

Action Start/End Rules:

  • Can START when: all non-stream inputs have arrived (or ≥1 stream input if only streams exist)
  • Can FINISH when: all inputs arrived + all non-stream/non-exception outputs provided (or an exception output)
  • Deadlock prevention: ALL input pins must be ready simultaneously

7. Object Nodes — 4 Types

TypeDescriptionAnalogy
PinsInput/output of specific actionsIn-tray / out-tray on a desk
Activity Parameter NodesReceive/provide data to the whole activityFunction parameters
Central Buffer «centralbuffer»Buffer from multiple sources to multiple destinations; token goes to ONE destination onlyShared warehouse
Datastore «datastore»Persistent storage; tokens NEVER leave (only copies move out); new token replaces duplicateDatabase table

Object Node Extras:

FeatureSyntaxMeaning
Multiplicity[min..max]Min/max values accepted at each invocation
Upper Bound{upperBound=n}Max tokens node can hold; flow stops when full
Effect{create} / {read} / {update} / {delete}What action does to the object
Ordering{ordering=FIFO} / LIFOOrder tokens offered to outgoing edges

8. Special Activity Features

Partition (Swimlanes)

  • Divides nodes/edges by organizational unit (department, role)
  • Can be hierarchical and multidimensional
  • Same as BPMN swimlanes

🍎 Apple example: Activity Diagram with swimlanes: Customer lane | iOS App lane | Server lane

Pre & Post Conditions

«precondition» constraint    ← must be true BEFORE activity starts
«postcondition» constraint   ← must be true AFTER activity ends
«localPrecondition»          ← condition on a specific action
«localPostcondition»         ← condition after a specific action

SendSignalAction (pentagon shape)

  • Creates and sends a signal asynchronously — no reply expected
  • Like sending a text — fire and forget

AcceptEventAction

  • Accept event action (concave pentagon) — waits for a signal
  • Wait time action (hourglass) — waits for a time event
    • Relative: after (5 seconds)
    • Absolute: Jan, 1, 2000, Noon

InterruptibleActivityRegion (dashed rounded rectangle + ⚡)

  • When a token exits via interrupting edge → ALL tokens in region are terminated
  • Like an emergency stop button

Exceptions

Protected Node ──[ExceptionType]──▶ Handler Body Node
  • If not caught → propagates to enclosing protected node
  • If reaches top level uncaught → behavior unspecified

Selection & Transformation on Edges

  • Transformation: tokens are converted as they traverse an edge (like a data converter)
  • Selection: specifies order tokens are offered from object nodes; edge selection overrides node selection

9. Token Competition

  • Object nodes cannot duplicate tokens (unlike Fork nodes)
  • Multiple outgoing edges from one object node = competition — only one gets the token
  • Results in indeterminacy — which path gets the token is not guaranteed

🟣 PART II — State Machine Diagram


10. What Is a State Machine Diagram?

Shows discrete behavior of an object through finite state transitions.

  • Models the lifecycle of ONE object
  • State = behavioral condition of an object at a point in time
  • Two types: Simple state and Composite state (contains nested sub-states)

11. State Notation — All Elements

ElementSymbolDescription
Start● filled circleInitial pseudostate
End⊙ circle-in-circleFinal state
StateRounded rectangleCurrent condition of the object
TriggerArrow with labelEvent that causes transition
Guard[Condition] on arrowTransition only fires if condition is true
Fork━━ thick bar (one in, many out)Splits into concurrent regions
Join━━ thick bar (many in, one out)Synchronizes concurrent regions
Composite StateLarge rounded rect containing statesState containing nested sub-states

State Internal Activities:

StateName
────────────────
entry / entryActivity     ← runs when entering the state
do / doActivity           ← runs continuously while in the state
exit / exitActivity       ← runs when leaving the state

12. State Machine vs. Activity Diagram

Activity DiagramState Machine
FocusSystem behavior / process flowObject lifecycle / states
NodesActions, Control nodes, Object nodesStates
TransitionsEdges (control/object flow)Triggered transitions
Used forBusiness processes, algorithmsOrder status, ATM states, UI screens

🍎 Apple examples:

  • Activity: "How does App Store purchase work" → Activity Diagram
  • State Machine: "What states does an AirPods connection go through" → Disconnected → Connecting → Connected → Paused → Disconnected

🟢 PART III — Component Diagram


13. What Is a Component Diagram?

Shows components, interfaces, ports, and relationships — used in Component-Based Development (CBD) and Service-Oriented Architecture (SOA).

  • Each component = one clear responsibility
  • Components interact on a need-to-know basis only

14. Component Stereotypes

StereotypeMeaning
«executable»Program that runs on a node
«application»Several executables
«file»Source code or data file
«library»Static or dynamic library
«document»Document
«page»HTML page
«subsystem»Sub-system

15. Component Interfaces — Key Visual Symbols

InterfaceSymbolMeaning
Provided Interface🍭 Ball (lollipop)Services this component OFFERS to others
Required Interface🔌 SocketServices this component NEEDS from others

Provided = what you give (ball sticking out) Required = what you plug into (socket)


16. Two Connector Types

ConnectorPurpose
Delegation ConnectorLinks external port/interface to the internal realization of behavior
Assembly ConnectorConnects a component's Required Interface to another component's Provided Interface (ball-and-socket join)

🔴 PART IV — Deployment Diagram


17. What Is a Deployment Diagram?

Shows the physical hardware configuration and how software components are deployed on it.

  • Models runtime processing elements
  • Only components that exist at runtime appear here
  • Used AFTER decisions on: subsystem decomposition, concurrency, hardware/software mapping

18. Key Deployment Diagram Elements

ElementSymbolDescription
Device Node «device»3D boxPhysical hardware device
Processor «processor»3D boxProcessing hardware
Execution Environment «executionEnvironment»3D boxRuntime environment (JVM, Docker, etc.)
Artifact «artifact»Document iconPhysical piece of software (JAR, DLL, HTML)
ComponentComponent iconSoftware component deployed on node
Communication PathSolid lineConnection between nodes
DependencyDashed arrowOne element depends on another
Data StoreCylinderDatabase/storage

19. Big Picture — Which Diagram for What?

QuestionDiagram
How does this process/flow work?Activity Diagram
What states can this object be in?State Machine Diagram
What components exist and how do they connect?Component Diagram
Where does the software physically run?Deployment Diagram
Who does what and when? (roles + flow)Activity with Swimlanes/Partitions