Parking Lot

Requirements

Functional Requirements

  1. Add/remove parking floors and slots.

  2. Park and unpark vehicles.

  3. Calculate parking fees.

  4. Support multiple vehicle types (bike, car, truck).

  5. Support different payment methods.

Non-Functional Requirements

  1. Scalability for multi-floor parking.

  2. Low latency for check-in and check-out.

  3. Extendability for additional features like reservations.


High-Level Design (HLD)

Key Components

  1. Parking Lot: Manages floors, slots, and overall operations.

  2. Parking Floor: Contains multiple parking slots.

  3. Parking Slot: Represents a unit where a vehicle can park.

  4. Vehicle: Represents different types of vehicles (bike, car, truck).

  5. Ticket: Tracks vehicle entry and exit.

  6. 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

  1. Scalable: Supports multiple floors and vehicle types.

  2. Extensible: Easily add features like reservations.

  3. Maintainable: Clean segregation of responsibilities.

Future Enhancements

  1. Add reservation features.

  2. Integrate with payment gateways.

  3. Add a mobile-friendly UI for ease of use.

Last updated