π Critical Arrow Distinctions - Master These!
FILLED ARROWHEAD (Solid Triangle βΆ)
- β Synchronous messages (waits for response)
- β Control flow (activity diagrams)
- β State transitions
OPEN ARROWHEAD (V-Shape >)
- β Asynchronous messages (no wait)
- β Return messages (dashed line)
- β Include/Extend (dashed line)
HOLLOW TRIANGLE (Inheritance β³)
- β Generalization/Inheritance ONLY
- β Always points to parent/superclass
- β Used in Use Case & Class diagrams
NO ARROWHEAD (Association β)
- β Association (actor to use case)
- β Bidirectional relationship
- β No specific direction implied
1οΈβ£ Use Case Diagrams
Oval / Ellipse
Represents a use case - a specific function or action that the system provides to actors.
π Example: "Login", "Process Payment", "Generate Report"
Stick Figure
Represents an actor - an external entity (person, system, or organization) that interacts with the system.
π Example: "Customer", "Administrator", "Payment Gateway"
Rectangle / Box
Represents the system boundary - defines the scope of the system and what's inside vs outside.
π Contains all use cases of the system
Solid Line (Association)
Shows communication/participation between actor and use case.
β οΈ SOLID LINE - No arrowhead
π Meaning: Actor can initiate or participate in this use case
Β«includeΒ» Relationship
Base use case always includes the included use case. Mandatory inclusion.
β οΈ DASHED LINE + OPEN ARROWHEAD
π Example: "Login" includes "Validate Credentials"
Β«extendΒ» Relationship
Optional extension - extending use case may add behavior to base use case under certain conditions.
β οΈ DASHED LINE + OPEN ARROWHEAD (points TO base)
π Example: "Process Order" extends to "Apply Discount Code"
Generalization (Inheritance)
Inheritance relationship between actors or use cases. Child inherits properties of parent.
β οΈ SOLID LINE + HOLLOW TRIANGLE (points to parent)
π Example: "Admin" and "Guest" are specialized types of "User"
Aggregation (Hollow Diamond)
Weak "has-a" relationship - whole contains parts, but parts can exist independently when whole is destroyed.
β οΈ SOLID LINE + HOLLOW DIAMOND (points to whole)
π Example: University has Students (students can exist without university)
Composition (Filled Diamond)
Strong "has-a" relationship - whole contains parts, parts CANNOT exist independently when whole is destroyed.
β οΈ SOLID LINE + FILLED DIAMOND (points to whole)
π Example: House has Rooms (rooms cannot exist without the house)
2οΈβ£ Activity Diagrams
Filled Circle (β)
Represents the initial state / start node - where the activity begins.
π Only ONE per activity diagram
Bull's Eye (β)
Represents the final state / end node - where the activity terminates.
π Can have multiple end nodes
Rounded Rectangle
Represents an activity / action state - a task or operation being performed.
π Example: "Process Payment", "Validate Input", "Send Email"
Filled Diamond (β) - Decision
Decision node / branch - conditional flow with multiple outgoing paths based on conditions.
β οΈ FILLED DIAMOND (solid color inside)
π Guards shown in brackets: [condition], [else]
Empty Diamond (β) - Merge
Merge node - where multiple paths converge back into a single flow.
β οΈ EMPTY DIAMOND (hollow, no fill)
π Used after decision/branch to rejoin paths
Thick Bar - Fork
Fork node - splits flow into multiple parallel/concurrent activities that execute simultaneously.
β οΈ ONE input, MULTIPLE outputs
π All parallel activities start at the same time
Thick Bar - Join
Join node / synchronization - waits for ALL parallel activities to complete before continuing.
β οΈ MULTIPLE inputs, ONE output
π Must wait for all tasks to finish (synchronization point)
Arrow (Control Flow)
Control flow / transition - shows the sequence and direction of activities.
β οΈ SOLID LINE + FILLED ARROWHEAD
π Indicates order of execution
Swimlane / Partition
Vertical or horizontal partition - organizes activities by who performs them (roles/departments).
π Shows responsibility: Customer lane, System lane, Admin lane
3οΈβ£ Sequence Diagrams
Rectangle with Name
Represents an object/participant in the interaction. Name format: :ClassName or objectName:ClassName
π Example: :PaymentProcessor, user:User
Stick Figure (Actor)
Represents an external actor - typically a human user interacting with the system.
π Example: Customer, Administrator
Vertical Dashed Line
Lifeline - represents the object's existence over time in the sequence.
β οΈ VERTICAL DASHED LINE
π Extends from object box downward through the interaction
Activation Box
Thin vertical rectangle on lifeline - shows when the object is actively executing or processing.
π Duration of method execution or active state
Solid Arrow (Synchronous)
Synchronous message - sender waits for receiver to complete before continuing.
β οΈ SOLID LINE + FILLED ARROWHEAD
π Blocking call - waits for response
Open Arrow (Asynchronous)
Asynchronous message - sender continues immediately without waiting for receiver.
β οΈ SOLID LINE + OPEN ARROWHEAD
π Non-blocking call - fire and forget
Dashed Arrow (Return)
Return message - response or result sent back to caller.
β οΈ DASHED LINE + OPEN ARROWHEAD
π Optional - often implied in synchronous calls
Interaction Frame (alt)
Alternative flows - like if-else statement. Only one branch executes.
π Common operators: alt (alternative), opt (optional), loop (repetition), ref (reference)
Reference Frame (ref)
Reference to another diagram - indicates interaction continues in a separate sequence diagram.
π Used to simplify complex interactions by breaking them into smaller diagrams
Loop Frame (loop)
Repetition - interaction repeats based on condition or count.
π Example: [for each item], [while condition], [1..10]
4οΈβ£ State Machine Diagrams
Filled Circle (β)
Represents the initial state - where the object begins its lifecycle.
π Only ONE per state machine
Bull's Eye (β)
Represents the final state - where the object's lifecycle ends.
π Can have multiple final states
Rounded Rectangle (State)
Represents a state - a condition or situation in the object's lifecycle.
π Example: "Idle", "Processing", "Completed", "Error"
Arrow (Transition)
Transition - change from one state to another triggered by an event.
β οΈ SOLID LINE + FILLED ARROWHEAD
π Labeled with: event [guard] / action
Transition Label Format
event [guard] / action - Complete transition specification.
π event = trigger, [guard] = condition, action = what happens
Composite State
State with internal activities - shows actions performed during the state.
π entry/ = on entering, do/ = while in state, exit/ = on leaving
Entry Action (entry /)
Action performed when entering the state - executed once upon entry.
π Example: Initialize variables, start timers, log entry
Do Activity (do /)
Ongoing activity while in the state - continues until state exit.
π Example: Continuous monitoring, animation, polling
Exit Action (exit /)
Action performed when leaving the state - executed once upon exit.
π Example: Clean up resources, save state, log exit
π‘ Quick Memorization Tips
- Circles: Start (β) and End (β) points in activity and state diagrams
- Rectangles: Things that do work or hold state (activities, states, objects)
- Filled Diamond (β): Decision points (branching) in activity diagrams
- Empty Diamond (β): Merge points OR Aggregation (weak "has-a")
- Thick Bars: Parallel processing (fork to split, join to synchronize)
- Filled Arrow (βΆ): Strong relationship (synchronous call, transition, control flow)
- Open Arrow (>): Weak/dependency relationship (async, include, extend, return)
- Hollow Triangle (β³): Always means inheritance/generalization (points to parent)
- Stick Figures: Always external actors (people or systems)
- Remember: Filled = Strong/Decision, Empty = Weak/Merge, Dashed = Dependency
π― Complete Arrow Reference - All Types
| Visual | Arrow Type | Line Style | Head Type | Used In | Meaning |
|---|---|---|---|---|---|
| Control Flow | Solid | Filled Triangle βΆ | Activity, State | Sequence/transition | |
| Synchronous Call | Solid | Filled Triangle βΆ | Sequence | Waits for response | |
| Asynchronous Call | Solid | Open (V-shape) | Sequence | No wait, continues | |
| Return Message | Dashed | Open (V-shape) | Sequence | Response/result | |
| Β«includeΒ» | Dashed | Open (V-shape) | Use Case | Always includes | |
| Β«extendΒ» | Dashed | Open (V-shape) | Use Case | Optional extension | |
| Generalization | Solid | Hollow Triangle β³ | Use Case, State | Inheritance | |
| Association | Solid | None | Use Case | Communication | |
| Lifeline | Dashed (vertical) | None | Sequence | Object existence | |
| Aggregation | Solid | Hollow Diamond β | Class | Weak "has-a" | |
| Composition | Solid | Filled Diamond β | Class | Strong "has-a" |