Hi, I have few questions on the Parking lot design and would like to clarify it. Appreciate your help on this.
- The
Vehicle
has a one-way association withParkingTicket
. Where is it shown in terms of code. I see ParkingTicket is passed as a parameter to assignTicket() method. Can you please explain the object associations in terms of code.
- The
ParkingSpot
has a one-way association withVehicle
. - The
Vehicle
has a one-way association withParkingTicket
. - The
Payment
has a two-way association withParkingTicket
.
- ParkingTicket contains instances of the
Vehicle
,Payment
,Entrance
andExit
classes. Does this mean ParkingTicket is an Aggregate of all these objects? (Object Association) - Why does AddEntrance() and AddExit() methods are inside the ParkingLot, do they belong to Admin()?
- Who is instantiating the ParkingLot class. How does Vehicle, Entrance and ParkingLot are related here.
I have few other questions, but would like to get these clarified and analyze the system again. Thanks again for helping me on this.
Course: Grokking the Low Level Design Interview Using OOD Principles - Learn Interactively
Lesson: Code for the Parking Lot