What is a UML Diagram?
UML (Unified Modeling Language) is a standardized visual language used to model and design software systems. It helps represent the structure, behavior, and interactions in a system clearly and consistently.
- UML diagrams make it easier to understand, communicate, and document system designs.
- They are widely used in software engineering, architecture, and business process modeling.
Common Types of UML Diagrams (Brief)
- Class Diagram: Shows classes, attributes, methods, and relationships.
- Sequence Diagram: Shows object interactions over time.
- Activity Diagram: Models workflows or processes.
- Use Case Diagram: Shows system features and user interactions.
- State Diagram: Shows object states and transitions.
- Component Diagram: Shows high-level components and dependencies.
Common Controls & Notations Used in UML Diagrams
Here’s a list of the most common visual elements you’ll see in UML diagrams, especially focusing on arrows, lines, and symbols, with their meanings.
1. Association (Solid Line)
- What: A straight solid line connecting two classes or entities.
- Meaning: A structural relationship between classes, meaning one knows about the other.
- Example: A
Customer
class associated with anOrder
class.
2. Directed Association (Solid Line with Arrowhead)
- What: Solid line with a single arrow pointing from one class to another.
- Meaning: One class uses or “knows” the other in a specific direction.
- Example:
Order
knows aboutProduct
, but not necessarily vice versa.
3. Aggregation (Hollow Diamond)
- What: A solid line with a hollow diamond at one end.
- Meaning: Represents a whole-part relationship — the “whole” contains the “part” but parts can exist independently.
- Example:
Car
(whole) aggregatesWheel
(part). Wheels can exist separately.
4. Composition (Filled Diamond)
- What: A solid line with a filled (black) diamond at one end.
- Meaning: Stronger whole-part relationship — parts cannot exist without the whole.
- Example:
House
(whole) composed ofRoom
(part). Rooms don’t exist outside the house.
5. Generalization / Inheritance (Solid Line with Hollow Triangle)
- What: Solid line with a hollow triangle arrow pointing to the parent/superclass.
- Meaning: Indicates an “is-a” relationship (inheritance).
- Example:
Dog
class inherits fromAnimal
class.
6. Dependency (Dashed Line with Arrowhead)
- What: Dashed line with an arrow pointing from dependent to independent.
- Meaning: One element depends on another but the dependency is weak or temporary.
- Example: A method in class A uses class B.
7. Realization (Dashed Line with Hollow Triangle)
- What: Dashed line with a hollow triangle arrow pointing to the interface or abstract class.
- Meaning: Indicates that a class implements an interface.
- Example:
Car
class realizesIVehicle
interface.
8. Message / Call (Solid or Dashed Arrow in Sequence Diagrams)
- What: Arrow from one object lifeline to another.
- Meaning: Represents a method call or message sent.
- Solid arrow: synchronous call (waits for result).
- Dashed arrow: asynchronous call or return message.
9. Control Flows (Arrows in Activity Diagrams)
- What: Solid arrow showing direction of flow.
- Meaning: Flow of control from one action or decision to the next.
10. Guard Condition (In Square Brackets)
- What: Text in
[ ]
on control flow arrows. - Meaning: Condition that must be true for the flow to proceed.
11. Fork & Join Bars (Activity Diagrams)
- What: Thick horizontal or vertical bars.
- Meaning:
- Fork: Splits a flow into multiple parallel flows.
- Join: Synchronizes multiple flows into one.
12. Lifeline (Sequence Diagram)
- What: Vertical dashed line below an object.
- Meaning: Represents the lifespan of an object during interaction.
13. Activation Box (Sequence Diagram)
- What: Thin rectangle on a lifeline.
- Meaning: Represents time during which an object is active or processing.
Summary Table
Symbol/Line Type | Appearance | Meaning | Used In |
---|---|---|---|
Association | Solid line | Structural relationship | Class Diagram |
Directed Association | Solid line + arrow | One-way knowledge | Class Diagram |
Aggregation | Solid line + hollow diamond | Whole-part (weak) | Class Diagram |
Composition | Solid line + filled diamond | Whole-part (strong) | Class Diagram |
Generalization | Solid line + hollow triangle | Inheritance ("is-a") | Class Diagram |
Dependency | Dashed line + arrow | Weak dependency | Class Diagram |
Realization | Dashed line + hollow triangle | Implementation of interface | Class Diagram |
Message / Call | Arrow (solid/dashed) | Method call or message | Sequence Diagram |
Control Flow | Solid arrow | Flow between actions | Activity Diagram |
Guard Condition | Text in [ ] on arrow | Condition for flow | Activity Diagram |
Fork/Join Bar | Thick bar | Split/merge parallel flows | Activity Diagram |
Lifeline | Vertical dashed line | Object lifespan | Sequence Diagram |
Activation Box | Thin rectangle on lifeline | Object activation period | Sequence Diagram |
Tags
System Design