This project is a Low-Level Design (LLD) of a simple ride-sharing system, similar to platforms like Uber or Ola. The system demonstrates object-oriented principles, service-based design, and basic ride booking logic in Java.
- Rider can request a ride by specifying source and destination.
- Drivers are registered with the system along with vehicle details.
- The system matches available drivers to ride requests using a service-based approach (
FindingDriverService). - Fare calculation based on the type of vehicle:
- Bike =
baseFaree* 1.00 - Car =
baseFare* 1.50 - Luxury =
baseFare* 2.00
- Bike =
- Ride status tracking:
REQUESTED→ONGOING→COMPLETED. - Simple logging of ride start, completion, and fare.
User→ Abstract base class for Rider and Driver.Rider→ Represents a rider, stores current location, can request rides.Driver→ Represents a driver, stores vehicle info and availability.Vehicle→ Represents a vehicle with type and license plate.Ride→ Represents a ride, stores rider, driver, source, destination, fare, and status.
FindingDriverService→ Interface for driver matching strategy.FindingRandomDriverService→ Implementation that finds the first available driver.
RideManager→ Singleton class managing drivers, rides, and matching logic.