How dykriooo/parking_lot_lld works
This is a parking-lot management model: vehicles enter, receive a ticket for a compatible occupied spot, then calculate and pay a fee before the spot is released. ParkingLot owns the central workflow; floors and spots manage capacity, while pricing and payment strategies provide interchangeable policies. Gate and vehicle-factory capabilities are represented from the source index, but their full implementations were not excerpted. The README provides no additional capability details.
Main entry points: ParkingLot.py Parking lot · PaymentStrategyFactory.py Payment factory · PaymentStrategy.py Payment contract · PricingStrategyFactory.py Pricing factory
Components 21
Parking operations
- Entry gate
model/EntryGate.py - Parking lot
service/ParkingLot.py - Exit gate
model/ExitGate.py
Parking domain
- Parking floor
model/ParkingFloor.py - Parking spot
model/ParkingSpot.py - Parking ticket
model/Ticket.py - Vehicle types
model/Vehicle.py - Vehicle factory
factory/VehicleFactory.py - Gate model
model/Gate.py - Domain enums
enums
Pricing
- Pricing factory
factory/PricingStrategyFactory.py - Pricing contract
strategy/pricing/PricingStrategy.py - Time pricing
strategy/pricing/TimeBasedPricing.py - Event pricing
strategy/pricing/EventBasedPricing.py
Payments and factories
- Payment factory
factory/PaymentStrategyFactory.py - Payment processor
service/PaymentProcessor.py - Payment contract
strategy/payment/PaymentStrategy.py - Cash payment
strategy/payment/CashPayment.py - Card payment
strategy/payment/CardPayment.py - UPI payment
strategy/payment/UPIPayment.py
Other components
- Parking user
Connections 26
- Entry gate → Parking lot: parks through
model/EntryGate.py - Exit gate → Parking lot: exits through
model/ExitGate.py - Parking lot → Parking floor: searches floors
service/ParkingLot.py - Parking lot → Parking ticket: creates ticket
service/ParkingLot.py - Parking lot → Pricing factory: selects pricing
service/ParkingLot.py - Parking lot → Pricing contract: calculates fee
service/ParkingLot.py - Parking lot → Payment factory: selects payment
service/ParkingLot.py - Parking lot → Payment processor: processes payment
service/ParkingLot.py - Parking lot → Parking spot: vacates spot
service/ParkingLot.py - Parking floor → Parking spot: finds available
model/ParkingFloor.py - Pricing factory → Time pricing: creates strategy
factory/PricingStrategyFactory.py - Pricing factory → Event pricing: creates strategy
factory/PricingStrategyFactory.py - Time pricing → Pricing contract: implements
strategy/pricing/TimeBasedPricing.py - Event pricing → Pricing contract: implements
strategy/pricing/EventBasedPricing.py - Payment factory → Cash payment: creates strategy
factory/PaymentStrategyFactory.py - Payment factory → Card payment: creates strategy
factory/PaymentStrategyFactory.py - Payment factory → UPI payment: creates strategy
factory/PaymentStrategyFactory.py - Payment processor → Payment contract: invokes payment
service/PaymentProcessor.py - Cash payment → Payment contract: implements
strategy/payment/CashPayment.py - Card payment → Payment contract: implements
strategy/payment/CardPayment.py - UPI payment → Payment contract: implements
strategy/payment/UPIPayment.py - Vehicle factory → Vehicle types: creates vehicles
factory/VehicleFactory.py - Entry gate → Gate model: uses gate model
model/EntryGate.py - Exit gate → Gate model: uses gate model
model/ExitGate.py - Parking user → Entry gate: initiates parking
- Parking user → Exit gate: requests exit