🎯 Breakout Exercise 2

System Architecture Design Challenge
Week 4, Day 1 | Time: 15 minutes | Group Activity

🚀 Your Mission

Design a complete system architecture using ALL FOUR design patterns working together!

This is deeper than Breakout 1 - you're not just identifying patterns, you're designing how they INTEGRATE into a cohesive system.

⭐ Integration Challenge - All 4 Patterns!

📱 The Scenario: QuickEats Food Delivery App

You are the software architect for "QuickEats" - a food delivery platform competing with DoorDash and UberEats. Your job is to design the system architecture that makes this app work smoothly.

🏪 Multiple Restaurant Types
Fast food, Fine dining, Food trucks, Cloud kitchens - each with different menus and behaviors
🚗 Different Delivery Methods
Standard (45min), Express (20min), Scheduled (pick time), Contactless
🔔 Real-Time Notifications
Order placed → Preparing → Driver assigned → On the way → Delivered
👤 Shared User Session
Cart, preferences, and location must sync across phone, web, and tablet

📦 What You'll Create

1️⃣ System Architecture Diagram 7 minutes

Draw a visual map showing where each pattern fits and how they connect

2️⃣ Pattern Integration Explanation 5 minutes

Answer questions about how patterns work together and handle real scenarios

3️⃣ Group Presentation 3 minutes

Present your architecture to the class and explain design decisions

Part 1: Identify Pattern Roles (2 minutes - Individual Thinking)

Before designing together, individually check the boxes for what each pattern handles in this system:

🏭
Factory Pattern
Creates WHAT in QuickEats?
  • Restaurant menus
  • Restaurant instances (FastFood, FineDining, FoodTruck)
  • User accounts
  • Payment receipts
🔄
Strategy Pattern
Switches WHAT in QuickEats?
  • Delivery methods (Standard, Express, Scheduled)
  • Restaurant types
  • Notification types
  • App themes (dark mode, light mode)
📢
Observer Pattern
Notifies WHO in QuickEats?
  • User's phone when order status changes
  • Restaurant when new order arrives
  • Driver when assigned to order
  • All of the above
Singleton Pattern
ONE instance of WHAT?
  • Shopping cart per user session
  • User profile/preferences per session
  • App configuration settings
  • All of the above could be singletons
Part 2: Design System Architecture (7 minutes - Group Work)

Draw your QuickEats system architecture in the space below. Show:

Example structure to get you started:

┌─────────────────────┐
│ 🏭 Factory │ Creates: FastFood, FineDining, FoodTruck restaurants
│ RestaurantFactory │
└──────────┬──────────┘
           ↓
    [User selects Pizza Palace]
           ↓
┌─────────────────────┐
│ ⭐ Singleton │ ONE cart for entire session
│ ShoppingCart │ Syncs across all devices
└──────────┬──────────┘
           ↓
    [User checks out]
           ↓
┌─────────────────────┐
│ 🔄 Strategy │ Calculates delivery cost/time
│ DeliveryStrategy │ Standard? Express? Scheduled?
└──────────┬──────────┘
           ↓
    [Order placed!]
           ↓
┌─────────────────────┐
│ 📢 Observer │ Notifies:
│ OrderObserver │ • User's phone 📱
│ │ • Restaurant 🏪
│ │ • Driver 🚗
└─────────────────────┘
Draw your own architecture here! Use the space above, on paper, or on a whiteboard. Make it visual - boxes, arrows, labels. Be creative!

💡 Design Tips

  • Think about connections: How does Factory output connect to Singleton cart?
  • Show the flow: What happens when user clicks "Order Now"?
  • Label everything: Don't just draw boxes - explain what they do!
  • Keep it clear: Simple and understandable beats complex and confusing
Part 3: Scenario Walkthroughs (5 minutes - Group Discussion)

Trace these real-world scenarios through your architecture. Which patterns handle each step?

🍕 Scenario A: User Orders Pizza

1
User opens app →
2
Selects "Pizza Palace" restaurant →
3
Adds pepperoni pizza to cart →
4
Chooses "Express Delivery" →
5
Places order →

✅ Scenario B: Restaurant Confirms Order

When Pizza Palace marks order as "Preparing":

1. Who needs to be notified? List all parties:
2. Which pattern handles these notifications? How does it work?

📱 Scenario C: User Switches Devices

  1. User adds 3 items to cart on phone
  2. Opens QuickEats app on tablet
  3. Sees the same 3 items in cart
  4. Changes delivery address
Which pattern ensures cart syncs across devices? Explain WHY this pattern is needed:
Part 4: Pattern Interaction Questions (3 minutes - Critical Thinking)

Answer these questions to demonstrate deep understanding of how patterns work TOGETHER:

1. CONNECTION QUESTION:

The Factory creates a "FoodTruck" restaurant. The user orders. The Observer notifies the driver. How does the Observer know WHICH driver to notify? (Hint: What other components must be involved?)

2. INTEGRATION QUESTION:

If we REMOVED the Singleton pattern from QuickEats, what would break? Give 2 specific problems that would occur:

Problem 1:

Problem 2:

3. DESIGN DECISION QUESTION:

Could we use the Strategy pattern instead of the Factory pattern for creating restaurants? Why or why not? What's the fundamental difference?

4. REAL-WORLD EXTENSION QUESTION:

QuickEats wants to add a new delivery method called "Drone Delivery" that's faster but more expensive. Which pattern handles this? Would any OTHER patterns need to change? Why?

🎤 Presentation Guide (3 minutes total)

Each group will present to the class. Prepare to share:

Your 3-Minute Presentation Should Cover:

  1. 📊 Show your architecture diagram (1 minute)
    • Point out where each of the 4 patterns fits
    • Explain how they connect
  2. 🎬 Walk through ONE scenario (1 minute)
    • Pick Scenario A, B, or C
    • Trace the flow through your system
  3. 💭 Answer this question: (1 minute)
    • "What was the hardest design decision your group made?"
    • OR "What surprised you about how patterns interact?"
Presentation Tips:
  • Speak clearly and confidently
  • Everyone in the group should speak
  • Use your diagram - point to things!
  • Explain WHY you made design choices

✅ Success Criteria

You've successfully completed this exercise if you can:

✓ Place all 4 patterns correctly in your system
✓ Explain HOW patterns interact (not just WHERE they are)
✓ Trace real scenarios through your architecture
✓ Justify your design decisions with reasoning

Remember: This isn't about perfect code - it's about understanding how patterns work TOGETHER!

Think like an architect, not a coder. Design the structure, explain the connections! 🏗️