Requirements


Functional Requirements:


  • Assign first-fitting spot - On arrival, find the earliest free spot that can fit the vehicle size across floors.
  • Issue ticket on entry - Generate unique ticket with vehicle, spot, and entry time.
  • Compute fee on exit - Calculate duration and apply active PricingStrategy.
  • Lot full handling - If no suitable spot exists, indicate 'Lot Full'.


Core Objects & Relationships

Based on the requirements and use cases, identify the main objects of the system and analyze how they interact and relate to each other...

1.spot:size,

2.ticket: startTime, endTime

3.parkingLot: park, findSpot,

4.floor




APIs & Class Members

parkingLot.park(vehicle)

parkingLot.pay(vehicle)

parkingLot.exit(vehicle)


parkingLot -> spots -> findEmpty -> used spot -> return spotId


parkingLot -> spots -> removeSpot -> remove uesed spot mark -> pay -> ticket -> spotId startTime, endTime


Deep Dive

Explain design tradeoffs you considered. Check and explain whether your design adheres to SOLID principles. Explain how your design can handle changes in scale and whether it would be easy to extend with new functionalities. Identify areas for future improvement...