Parking Lot
Requirements
Functional Requirements
Add/remove parking floors and slots.
Park and unpark vehicles.
Calculate parking fees.
Support multiple vehicle types (bike, car, truck).
Support different payment methods.
Non-Functional Requirements
Scalability for multi-floor parking.
Low latency for check-in and check-out.
Extendability for additional features like reservations.
High-Level Design (HLD)
Key Components
Parking Lot: Manages floors, slots, and overall operations.
Parking Floor: Contains multiple parking slots.
Parking Slot: Represents a unit where a vehicle can park.
Vehicle: Represents different types of vehicles (bike, car, truck).
Ticket: Tracks vehicle entry and exit.
Payment: Handles fee calculation and processing.
HLD Diagram
Low-Level Design (LLD)
1. Classes and Responsibilities
ParkingLot
Manages multiple parking floors.
Tracks availability.
ParkingFloor
Contains multiple parking slots.
Identifies available slots.
ParkingSlot
Represents a single slot.
Tracks availability and vehicle type.
Vehicle
Contains details like type, registration number, and owner.
Ticket
Tracks entry time, exit time, and parking fees.
Payment
Handles fee calculation and payment processing.
Class Diagram
Implementation in Java (Spring Boot)
1. Enum for Vehicle Type
2. Parking Slot
3. Parking Floor
4. Ticket
5. Parking Lot
Flow Diagram
Advantages
Scalable: Supports multiple floors and vehicle types.
Extensible: Easily add features like reservations.
Maintainable: Clean segregation of responsibilities.
Future Enhancements
Add reservation features.
Integrate with payment gateways.
Add a mobile-friendly UI for ease of use.
Last updated