Theory of Intelligence
11TH•Computer Science•Introduction To Software Development•Question 4

Solution

You are developing a food delivery application. Create a Sequence Diagram to show the process of placing an order, from the customer selecting items to the delivery of the order.

Solution

Sequence Diagram: Food Delivery Order Process

Objects (Lifelines):

  1. Customer – The user placing the order.
  2. Mobile App – The food delivery application.
  3. Order Service – Handles order creation and processing.
  4. Payment Service – Processes payments.
  5. Restaurant System – Receives and prepares the order.
  6. Delivery Service – Manages delivery personnel and tracks delivery.

Sequence of Messages:

TEXT
Customer → Mobile App: Browse menu and select items
Customer → Mobile App: Add items to cart
Customer → Mobile App: Click "Place Order"

Mobile App → Order Service: Create order (items, customer details, address)

Order Service → Payment Service: Process payment (amount, payment info)
Payment Service → Order Service: Return "Payment Successful"

Order Service → Mobile App: Show order confirmation
Order Service → Restaurant System: Send order notification

Restaurant System → Order Service: Confirm order received

(Time passes - Food Preparation)

Restaurant System → Delivery Service: Notify order ready for pickup

Delivery Service → Delivery Person: Assign delivery task

Delivery Person → Delivery Service: Pick up order
Delivery Service → Mobile App: Update status "Order Picked Up"

Delivery Person → Customer: Deliver order
Delivery Person → Delivery Service: Mark order as "Delivered"

Delivery Service → Mobile App: Update status "Order Delivered"
Mobile App → Customer: Show delivery confirmation

Textual Representation:

TEXT
Customer        Mobile App      Order Service    Payment Service    Restaurant Sys    Delivery Service
    │               │                │                │                  │                   │
    │──Browse & Add─│                │                │                  │                   │
    │──Place Order──│                │                │                  │                   │
    │               │──Create Order─▶│                │                  │                   │
    │               │                │──Process Pay─▶│                  │                   │
    │               │                │◀─Payment OK──│                  │                   │
    │               │◀─Confirm Order─│                │                  │                   │
    │               │                │──Notify Order──────────────────▶│                   │
    │               │                │◀─Confirm────────────────────────│                   │
    │               │                │                │                  │                   │
    │               │                │                │                  │──Order Ready─────▶│
    │               │                │                │                  │                   │
    │               │                │                │                  │                   │──Assign Deliver─│
    │               │                │                │                  │                   │
    │               │◀─Status Update──────────────────────────────────────────────────────────│
    │               │                │                │                  │                   │
    │               │                │                │                  │                   │
    │◀─Delivered──────────────────────────────────────────────────────────────────────────────────

Discuss theoretical concepts, mathematical formulas, and architectural foundations.

Supports inline code with `backticks`
No comments yet. Be the first to start the discussion!