Advanced Pizza Delivery Tracking System: Solution


Scenario 1: Taking an Order

  1. Customer calls in and tells order to Employee
  2. Employee enters order into the system:
  3. Employee enters pizza details (repeat if multiple pizzas)
  4. Employee enters customer name, phone number, and address
  5. System puts order into queue and it shows up on the tracking display UI

Scenario 2: Updating Status

  1. An employee takes a pizza from the oven and puts it in a box.
  2. The employee scans the pizza barcode with a wand attached to the real time tracking display, indicating that it is ready.
  3. The pizza tracking display updates to show the ready status of the pizza.

Scenario 3: Order/Driver Assignment

In this scenario, there are several orders already in the queue.

  1. Manager sees 2 'ready' orders on real time tracking display
  2. Manager assigns a driver to take the 2 orders.
  3. The driver takes the pizzas for the orders, using a handheld device to scan the pizzas.
  4. The pizza tracking display changes to show the status of the two orders.

Scenario 4: Delivery

In this scenario, a driver has accepted an order to deliver and has arrived at the customer's address.

  1. Driver arrives at customer's door and scans pizza(s) with handheld.
  2. The system updates the order status and, using the current system time, determines whether pizzas are late.
  3. The system sends the total price and any late discount to the handheld.
  4. The driver gives the pizzas to the customer, reads the total amount due from the handheld, and receives that amount from the customer.

Scenario 5: End of Day

  1. The manager stops taking orders, waits for pizzas in queue to be delivered, then uses an option on the tracking display UI to generate the daily report.
  2. The system writes out the daily statistics in CSV format, suitable for import into a spreadsheet. The filename is determined by the current date.

Design: Classes

TrackingSystem represents the system as a whole and coordinates startup and shutdown activities.
OrderEntryUI takes care of all user interface details for the order entry part of the system.
TrackingDisplayUI takes care of displaying the current state of the orders as their state changes.
HandheldGateway represents an interface to a collection of wireless handlheld devices used for tracking pizzas.
OrderPrinter takes care of printing pizza orders to a printer device.
OrderQueue keeps a queue of order objects and notifies interested parties when the queue changes.
Order represents a single customer order and is responsible for calculating the order price and keeping track of its on time status.
Pizza represents a single pizza and is responsible for tracking the pizza's information and calculating its price.
ScannerGateway represents an interface to a scanner used for marking a pizza as "ready for delivery".
Customer represents customer information for an order; not intended to be unique.
Driver represents a driver with a collection of orders currently being delivered.
History represents a history data store and is responsible for recording events of interest for later processing.

Design: Class Diagram