educative.io

Educative

Circular dependency between terminal and parkinglot?

Hi @Design_Gurus
It is written in ParkingLot class that entrancePanel will be using getNewParkingTicket() method.
For that we need ParkingLot reference in EntrancePanel class. As ParkingLot is already owning terminal having a ParkingLot reference in entrancePanel will create a circular dependency between the two.
Really confused at this.

What should be the correct way to tackle this.

Thanks.