Applying Use Case Diagrams: Parking Lot System
Let's apply use case diagram principles to design a Parking Lot System. This demonstrates how to identify actors, extract use cases from requirements, and model relationships.
Gateway
Association: Customer connects to Find Parking Spot, Park Vehicle, and Pay Parking Fee
<<include>>: Pay Parking Fee includes Process Payment (always required)
<<include>>: Park Vehicle includes Issue Ticket (mandatory action)
Shared Use Case: Both Customer and Attendant can initiate Issue Ticket
Design Decisions Explained:
First, Why is Process Payment a separate use case? Payment processing is complex enough to warrant its own use case. It's included by Pay Parking Fee because every payment requires processing. However, if Y (the payment gateway is unreliable), then you might model Retry Payment as an extending use case that handles failures.
Second, Why can both Customer and Attendant issue tickets? This reflects real-world scenarios where automated kiosks (Customer) and manned booths (Attendant) both provide tickets. The system must support both interaction modes.
Third, Should Exit Parking be a separate use case? Yes, if it involves validation and barrier control. But if it's just a consequence of payment, then it can be part of the Pay Parking Fee workflow. This depends on business requirements.