SOFTWARE ENGINEERING
Easy Study Notes
─────────────────────────────────────────
Activity Diagram & Data Flow Diagram
─────────────────────────────────────────
Simple Language • Clear Diagrams • Real Examples
University Level Course Material
📊 PART 1: ACTIVITY DIAGRAM
1.1 What is an Activity Diagram?
An Activity Diagram is like a flowchart that shows the step-by-step flow of activities in a system or
process. It tells us:
• What steps happen in a process
• In what order the steps happen
• Where decisions are made (yes/no choices)
• Which steps can happen at the same time
💡 Simple Analogy: Think of an Activity Diagram as a recipe card. It shows you — first do
this, then do that, and if something happens, do this instead.
1.2 Symbols Used in Activity Diagram
Symbol Meaning
● Start Node (Filled Circle) Shows where the process BEGINS. There is only ONE
start.
◉ End Node (Bull's Eye Circle) Shows where the process ENDS. There can be multiple
ends.
[ Rectangle ] Action / Activity Shows a single step or task (e.g., Enter Password).
◇ Decision Node (Diamond) A yes/no question. Flow goes in different directions.
═══ Fork / Join Bar (Thick Line) FORK: splits into parallel activities. JOIN: merges them
back.
───▶ Control Flow Arrow Shows the direction of flow from one step to the next.
[ ] Guard Condition Written on arrows from a decision (e.g., [yes], [no],
[valid]).
Swim Lane (Vertical Partition) Divides diagram into who does what (e.g., User,
System).
1.3 Example 1 — User Login Process
This example shows what happens when a user tries to log in to a website.
● START
|
▼
┌─────────────────────┐
│ Enter Username │
│ & Password │
└─────────────────────┘
|
▼
┌─────────────────────┐
│ Click Login Button │
└─────────────────────┘
|
▼
◇ ◇ ◇
Credentials Correct?
/ \
[YES] [NO]
| |
▼ ▼
┌──────────────┐ ┌──────────────────┐
│ Show Home │ │ Show Error │
│ Dashboard │ │ Message │
└──────────────┘ └──────────────────┘
| |
| ▼
| ┌──────────────────┐
| │ Allow Retry? │
| └──────────────────┘
| / \
| [YES] [NO]
| | |
| (go back to ▼
| Enter step) ◉ END (Locked)
|
▼
◉ END (Success)
◇Notice: The diamond shape (◇) is the Decision Point. Two arrows come out — one for
YES, one for NO.
1.4 Parallel Activities (Fork & Join)
Sometimes two activities happen at the same time. We use a thick bar (Fork) to split and another thick
bar (Join) to merge.
● START
|
▼
┌─────────────────────┐
│ Customer Places │
│ Online Order │
└─────────────────────┘
|
▼
══════════════════════════ ← FORK (split into parallel)
/ \
▼ ▼
┌──────────┐ ┌──────────────┐
│ Process │ │ Send Order │
│ Payment │ │ Confirmation│
│ │ │ Email │
└──────────┘ └──────────────┘
| |
▼ ▼
══════════════════════════ ← JOIN (both must finish)
|
▼
┌─────────────────────┐
│ Dispatch the Order │
└─────────────────────┘
|
▼
◉ END
💡 Key Point: After a FORK, BOTH activities run together (in parallel). The JOIN bar waits
for ALL activities to finish before continuing.
1.5 Swim Lanes — Who Does What?
Swim Lanes divide an activity diagram into columns. Each column belongs to one person, department,
or system. This shows who is responsible for each step.
┌────────────────────┬──────────────────────┐
│ CUSTOMER │ SYSTEM │
├────────────────────┼──────────────────────┤
│ │ │
│ ● START │ │
│ | │ │
│ ▼ │ │
│ ┌────────────────┐ │ │
│ │ Search Product │ │ │
│ └────────────────┘ │ │
│ | │ │
│ ▼ │ │
│ ┌────────────────┐ │ ┌────────────────┐ │
│ │ Add to Cart │─┼──▶│ Update Cart │ │
│ └────────────────┘ │ └────────────────┘ │
│ │ | │
│ │ ▼ │
│ ┌────────────────┐ │ ┌────────────────┐ │
│ │ Make Payment │─┼──▶│ Process Payment│ │
│ └────────────────┘ │ └────────────────┘ │
│ │ | │
│ │ ▼ │
│ │ ┌────────────────┐ │
│ │ │ Send Receipt │ │
│ │ └────────────────┘ │
│ │ | │
│ │ ◉ END │
└────────────────────┴──────────────────────┘
1.6 When Do We Use Activity Diagrams?
• To model business processes (e.g., how a bank processes a loan)
• To show the flow of a use case (e.g., how a user places an order)
• To show parallel processes (e.g., cooking and setting the table at the same time)
• To understand complex logic before writing code
1.7 Quick Summary — Activity Diagram
Topic Details
Full Name Unified Modeling Language (UML) Activity Diagram
Purpose Shows flow of activities / steps in a process
Main Shapes Circle, Rectangle, Diamond, Thick Bar, Arrows
Decision Shape Diamond (◇) — Yes/No choices
Parallel Flows Fork (split) and Join (merge) using thick bars
Swim Lanes Columns that show who does each activity
Used In System design, business process modeling, use case detail
Looks Like An advanced flowchart with parallel paths
📐 PART 2: DATA FLOW DIAGRAM (DFD)
2.1 What is a Data Flow Diagram?
A Data Flow Diagram (DFD) shows how data (information) moves through a system. It does NOT show
the order of steps (like an activity diagram). Instead, it shows:
• Where data comes from (inputs)
• Where data goes (outputs)
• What happens to the data (processes)
• Where data is stored (data stores)
💡 Simple Analogy: Think of a DFD like a water pipe system. Water (= data) flows from one
place to another. Some places store water (= data stores). Some places process the water
(= processes).
2.2 The 4 Symbols of DFD
Symbol What It Means / Example
Rectangle / Square A person or system OUTSIDE that gives or receives data.
(External Entity) Examples: Customer, Admin, Bank. Also called: Source or Sink.
Circle / Oval (Process) A step that TRANSFORMS data. It receives input and produces
output. Examples: Validate Login, Calculate Bill. Labeled with a
number + name.
Open Rectangle / Two A place where data is STORED. Examples: Student Database,
Lines (Data Store) Order File. Labeled as D1, D2, etc.
Arrow (→) (Data Flow) Shows the MOVEMENT of data from one place to another.
Always labeled with what kind of data is flowing. Examples:
Order Details, Student Info.
2.3 Levels of DFD
DFDs are drawn in levels. Each level gives more detail than the previous one.
Level Description
Context Diagram (Level The simplest DFD. Shows the WHOLE system as ONE process.
0) Only shows external entities and main data flows. No details inside
the system.
Level 1 DFD Breaks the one process from Level 0 into main sub-processes.
Shows data stores and more specific data flows.
Level 2 DFD Breaks each Level 1 process into even smaller processes. Used
for complex systems. Gives very detailed view.
2.4 Example 1 — Context Diagram (Level 0) for Online Shopping System
This shows the entire Online Shopping System as ONE circle, with data flowing in and out from
external entities.
┌────────────┐ Order Details ┌───────────────┐
│ │ ────────────────────────────────▶ │ │
│ CUSTOMER │ │ ONLINE │
│ │ ◀──────────────────────────────── │ SHOPPING │
└────────────┘ Order Confirmation │ SYSTEM │
│ (Process) │
┌────────────┐ Stock Update │ │
│ │ ◀──────────────────────────────── │ │
│ SUPPLIER │ │ │
│ │ ────────────────────────────────▶ │ │
└────────────┘ Restock Request └───────────────┘
│
│ Payment Info
▼
┌────────────────────┐
│ PAYMENT BANK │
└────────────────────┘
│
│ Payment Status
▼
(back to Online Shopping System)
✅ Notice: In a Context Diagram, the entire system is ONE circle/oval. External entities
(Customer, Supplier, Bank) are boxes. Arrows show what data moves in and out.
2.5 Example 2 — Level 1 DFD for Online Shopping System
Now we OPEN the one big circle and show the main processes inside the system.
┌──────────┐ Login Details ┌──────────────┐ User Record
│ │ ───────────────▶ │ 1.0 │ ◀──────────── ═══════════
│ CUSTOMER │ │ Validate │ D1: Users
│ │ ◀─────────────── │ User Login │ ──────────────▶ Database
└──────────┘ Login Status └──────────────┘ Verified User ═══════════
│ │
│ Browse / Search │ Verified User
▼ ▼
┌──────────┐ ┌──────────────────┐ Product Info
│ CUSTOMER │ ─ Search ──▶ │ 2.0 │ ◀──────────── ═══════════
│ │ │ Search & │ D2: Product
│ │ ◀─ Results ── │ Display Product │ ──────────────▶ Catalog
└──────────┘ └──────────────────┘ ═══════════
│
│ Place Order
▼
┌──────────┐ Order Info ┌──────────────────┐ Order Record
│ CUSTOMER │ ────────────▶ │ 3.0 │ ──────────────▶ ═══════════
│ │ │ Process Order │ D3: Orders
│ │ ◀──────────── │ │ ◀────────────── ═══════════
└──────────┘ Order Confirm└──────────────────┘ Order Details
│
│ Payment Request
▼
┌──────────────────┐ Payment Status
│ 4.0 │ ◀────────────── ┌────────┐
│ Process Payment │ │ BANK │
│ │ ────────────────▶└────────┘
└──────────────────┘ Payment Details
✅ Notice: Each circle is a Process (1.0, 2.0, 3.0, 4.0). Double-line boxes are Data Stores
(D1, D2, D3). Arrows are labeled with the data they carry.
2.6 Important Rules for Drawing a DFD
1. Every process must have at least one input and one output.
2. Data cannot flow directly from one external entity to another. It must pass through a process.
3. Data cannot flow directly from one data store to another. It must pass through a process.
4. Every data flow arrow must be labeled with what data is flowing.
5. Processes must be numbered (1.0, 2.0, 3.0...).
6. Data stores are labeled (D1, D2, D3...).
2.7 Common Mistakes to Avoid
Wrong Right / Correct
❌ Mistake ✅ Correct Way
Customer ──▶ Bank (direct flow Customer ──▶ Process ──▶ Bank (data must pass
between entities) through a process)
D1 ──▶ D2 (store to store D1 ──▶ Process ──▶ D2 (must process the data first)
without a process)
Unlabeled arrows Always write what data the arrow carries
No data store connection to Processes that need stored data must connect to a data
process store
2.8 Quick Summary — Data Flow Diagram
Topic Details
Full Name Data Flow Diagram (DFD)
Purpose Shows how data moves through a system
4 Symbols Rectangle (Entity), Circle (Process), Open Box (Data Store),
Arrow (Data Flow)
Context Diagram Level 0 — entire system in ONE circle
Level 1 Main processes inside the system shown
Level 2 Further detail of each Level 1 process
Focus Data movement, not time or sequence
Does NOT Show Who does the task, time order, decisions
⚖️ PART 3: ACTIVITY DIAGRAM vs DATA FLOW DIAGRAM
Feature / Property Activity Diagram vs DFD
Full Name Activity Diagram (UML) Data Flow Diagram
(DFD)
What It Shows Sequence / flow of activities / steps How data flows
through a system
Focus CONTROL flow — what happens next? DATA flow
— where does data go?
Shows Time Order Yes — steps follow a sequence No — only
shows data movement
Shows Decisions Yes — using Diamond shape (◇) No —
decisions are not shown
Shows Parallel Yes — using Fork and Join bars No
Shows Data Stores No Yes — D1, D2, D3
Main Shapes Circle, Rectangle, Diamond, Thick Bar Square,
Circle, Open Box, Arrow
Levels No levels — one diagram Context (L0),
Level 1, Level 2
Used For Use case modeling, business process, workflow System
analysis, requirements phase
Example User Login flow, ATM withdrawal steps Online
shopping data flow
🔑 Key Difference to Remember: Activity Diagram = FLOWCHART of ACTIONS (what
happens step by step) DFD = MAP of DATA (where data comes from, goes, and is stored)
3.1 Which Diagram to Use — Quick Guide
Situation Recommended Diagram
You want to show... Use this diagram
The steps to reset a password Activity Diagram
Where student data is stored Data Flow Diagram
Parallel tasks in a process Activity Diagram
How order information is processed Data Flow Diagram
Who does each activity in a team Activity Diagram (with Swim Lanes)
System input/output at high level DFD (Context Diagram)
A yes/no decision in a process Activity Diagram
Data stores and their connections Data Flow Diagram
📝 EXAM TIPS
Always label your arrows in a DFD. Unmarked arrows = marks deducted.
In an Activity Diagram, a Diamond = Decision. Always write [yes] and [no] on the outgoing
arrows.
Context Diagram = Level 0 DFD = entire system shown as ONE process/circle.
Fork = parallel START. Join = parallel END. Both must be present together.
Data cannot flow directly from one external entity to another in a DFD — it must always go
through a process.