ACE AI Startup BootcampDay 2: Sequence Diagrams and Data Flow Design
← Back to LMS Classroom
DAY 2 TEXTBOOKACE Startup SW/AI Pilot
ACE AI Startup Bootcamp Textbook Series 02

Sequence Diagrams and Data Flow Design

A self-study textbook covering essential theory, comparative examples, guided practice, quality review, and a capstone exercise. Central question: Which objects communicate behind the screen, and in what order?

ACE AI Startup Bootcamp | Day 2Study Guide
HOW TO STUDY

Learning Goals and Study Routine

Which objects communicate behind the screen, and in what order? You complete today’s lesson when you can answer this question in your own words, produce the required artifact, and review its quality.

Theory: 60 minPractice: 90 minReview: 30 min
01

Decompose a requirement into Actor, Boundary, Control, and Entity.

02

Distinguish synchronous messages, asynchronous events, and returns.

03

Use alt, opt, loop, and par fragments.

04

Explain race conditions created by concurrent requests.

05

Create an executable Mermaid sequence diagram.

06

Check consistency across requirements, APIs, and data models.

Recommended self-study routine

  1. Explain why a problem occurs before memorizing its terminology.
  2. Describe the difference between good and poor examples using observable criteria.
  3. Attempt the capstone before opening the model answer.
  4. Mark missing conditions in a second color and revise your artifact.
ACE AI Startup Bootcamp | Day 2Table of Contents
CONTENTS

Table of Contents

Completion standard

Submit the capstone artifact, score at least 80/100 on the self-review, and write your own answers to the four concept questions.

ACE AI Startup Bootcamp | Day 2Chapter 1 · Core Theory
CHAPTER 01

Core Theory: Sequence Diagrams and Data Flow Design

Each technical term exists to solve a recurring design problem. Study when and why the concept is needed, not merely its definition.

Core conceptWorking definition
LifelineThe time axis of a user, interface, service, database, or external participant.
MessageA request or response exchanged between participants.
ActivationThe interval in which a participant is performing work.
Combined FragmentA notation for alternatives, options, repetition, or parallel work.
BoundaryA UI or API at the edge between a user or external system and the application.
Control / EntityThe components that coordinate business flow and retain persistent data.

Poor and Effective Approaches

Avoid

Represent every internal responsibility as one generic “System” participant.

Prefer

Separate the reservation UI, reservation service, payment gateway, and database so ownership and failure points are visible.

Design formula

[Trigger] → [Participants] → [Sync/Async Messages] → [State Change] → [Response or Compensation]

ACE AI Startup Bootcamp | Day 2Chapter 2 · Guided Practice
CHAPTER 02

A Six-Step Design Workflow

1

Define the problem

Mark the user goal and initiating condition in the requirement.

2

Extract the structure

Extract the UI, services, external APIs, and data stores as participants.

3

Design the core flow

Place the happy-path requests and responses in chronological order.

4

Add failure conditions

Add failures, timeouts, and duplicates with alt fragments.

5

Connect policies

Connect locks, versions, or idempotency policies to shared resources.

6

Verify and trace

Trace requirement IDs to API and table names in the diagram.

Worked Example

Mermaid sequence diagram example
sequenceDiagram actor User participant UI as Booking UI participant API as Booking Service participant PG as Payment Gateway participant DB as Booking DB User->>UI: Select seat and time UI->>API: Create booking(idempotencyKey) API->>DB: Check availability API->>PG: Authorize payment alt Payment succeeds PG-->>API: Authorization ID API->>DB: Confirm booking API-->>UI: Booking complete else Payment fails PG-->>API: Failure reason API-->>UI: Show retry guidance end

Questions for reading the example

  • Are the input and initiating condition explicit?
  • Are success and failure outcomes observable?
  • Are duplication, authorization, concurrency, and dependency failure covered as needed?
  • Can the result be traced back to a requirement?
ACE AI Startup Bootcamp | Day 2Chapter 3 · Review
CHAPTER 03

Concept Check and Quality Review

CONCEPT CHECK
  1. When should a call be synchronous rather than event-driven?
  2. How do alt and opt fragments differ?
  3. Why should timeouts appear in the diagram?
  4. How can retransmitted requests avoid duplicate work?

Answer each in two or three sentences and add one example that supports your explanation.

Self-Assessment · 100 points

AreaStandardPoints
AccuracyConcepts and technical choices match the facts and requirements.25
CompletenessNormal flow, boundaries, failures, and recovery are covered.25
ConsistencyTerms, IDs, states, and interfaces agree across artifacts.20
VerifiabilityObservable outcomes and completion criteria are present.20
ReasoningThe choice and its tradeoffs can be explained clearly.10
If your score is below 80

Do not only correct the result. Record which question you failed to ask so your next design process prevents the same omission.

ACE AI Startup Bootcamp | Day 2Chapter 4 · Capstone
CHAPTER 04

Capstone Exercise and Model Answer

SUBMISSION

Design a sequence in which two users attempt to reserve the same seat. Include the case where payment succeeds but the database write fails.

  1. List assumptions and unresolved decisions first.
  2. Produce the main design as a table, diagram, or code block.
  3. Include the normal flow and at least three failures or boundaries.
  4. Score it with the rubric and compare before and after revision.
Open the model answer

The booking service must allow only one request to proceed by locking the seat row or validating a version. If payment succeeds but booking persistence fails, invoke an authorization void or refund as compensation and record an operational alert.

How to use the answer

The model is not the only valid design. If yours differs, explain the requirement, cost, complexity, or risk that justifies your choice.

ACE AI Startup Bootcamp | Day 2Lesson Review
REVIEW

Glossary and Final Checklist

TermPlain-English meaning
ActorA user or external system pursuing a goal.
LifelineA participant’s time axis.
altA conditional fragment that chooses one flow.
parA fragment containing flows that may run concurrently.
Race ConditionA result that depends on execution order.
CompensationA later action that reverses the effect of an earlier completed step.

Eight checks before submission

  1. Can you answer today’s central question in your own words?
  2. Are inputs, conditions, and results explicit?
  3. Did you include failures and recovery, not only the happy path?
  4. Did you review concurrency, duplicate requests, and permissions?
  5. Did you account for dependency failure and timeouts?
  6. Can you explain the disadvantages and alternatives to your choice?
  7. Are terminology and states consistent across artifacts?
  8. Is there an observable or testable completion standard?
Day 2 in one question

Which objects communicate behind the screen, and in what order? Answer it now using evidence from the artifact you created.

ACE AI Startup Bootcamp | Day 2Self-study reference
SELF-STUDY 01

Key Terms in Context

Learn each term as a decision tool. Read across each row: definition, reason to use it, and the failure it prevents.

TermPlain definitionWhy it mattersExample or caution
Synchronous callThe caller waits for a response before continuing.Use it when an immediate result is required.A slow dependency makes the whole request slow.
Asynchronous eventThe sender continues and receives the outcome through an event.It decouples notifications and follow-up work.Define ordering, retries, and duplicate consumption.
IdempotencyRepeating the same request produces the same final effect as one request.It prevents duplicate bookings and charges.Store a request key and return the recorded result.
Race conditionThe result changes depending on the order of concurrent work.It matters for scarce inventory and seats.Combine checking and updating in one protected operation.
TimeoutA call fails when no response arrives within a defined limit.It prevents indefinite waits and resource exhaustion.Pair it with retry limits and a user-facing outcome.
CompensationA later action reverses the effect of an earlier successful step.It repairs partial failure across services.Void a payment when saving the booking fails.
Practice scenario

Two users reserve the final seat at the same time, and the database write fails once after payment approval.

ACE AI Startup Bootcamp | Day 2Guided practice
SELF-STUDY 02

Guided Practice and Troubleshooting

Practice scenario

Two users reserve the final seat at the same time, and the database write fails once after payment approval.

Complete in order

  1. List the actor, UI, booking service, payment service, and database as lifelines.
  2. Draw the happy path first and label every message with its input and return value.
  3. Add concurrent requests, payment rejection, and save failure as separate alt branches.
  4. Assign ownership of idempotency, seat locking, and payment compensation.
Required evidence

Save one artifact, three assumptions, and at least three failure cases. A classmate should be able to reproduce your reasoning without asking what you meant.

If the result is wrong, diagnose it

Observed symptomLikely causeNext action
Seat sold twiceAvailability check and update are separateRow lock or conditional update
Payment approved twiceA retry is treated as a new requestIdempotency key and stored result
UI waits foreverNo dependency timeoutTimeout, retry limit, and failure response
ACE AI Startup Bootcamp | Day 2Retrieval practice
SELF-STUDY 03

Check Your Understanding

Retrieval check — answer before opening

How do alt and opt differ?

alt chooses one of multiple guarded paths; opt runs one optional path only when its guard is true.

Why compensate after a save failure?

It resolves the mismatch where money moved but no booking exists.

When is the diagram complete?

Normal, failure, and recovery paths have clear owners and map to implementation elements.

Teach it back in two minutes

Explain the day's main decision, one failure mode, and one verification method without reading the page. If you cannot connect all three, return to the row or diagnostic case you missed.