|
1 |
| -# Uber-Low-Level-Design |
| 1 | +# Uber Low Level System De# C++ |
| 2 | +This project, **Uber Low-Level System De# Cpp**, aims to simulate a simplified version of the ride-hailing service Uber using modern C++ features. |
2 | 3 |
|
3 |
| -Class Diagram |
4 |
| -<br> |
| 4 | +The **primary objective** behind this project is to deepen the understanding of low-level system de# C++, encompassing Object-Oriented Programming (OOP) principles, threading concepts, and modern C++ features such as Smart Pointers and the Standard Template Library (STL). |
5 | 5 |
|
| 6 | +In this design, we have focused on creating a robust and maintainable codebase by incorporating two key design patterns: **Singleton** and **Strategy**. The Singleton pattern is employed to ensure that there is only one instance of crucial manager classes such as ``DriverMgr``, ``RiderMgr``, ``TripMgr``, and ``StrategyMgr``. This guarantees centralized management of drivers, riders, trips, and strategies, ensuring thread-safe access and preventing resource conflicts. The Strategy pattern is leveraged to encapsulate algorithms for # and driver matching. By defining a family of algorithms and making them interchangeable, the system can dynamically change its behavior without altering the client code. Classes such as ``Default#Strategy``, ``RatingBased#Strategy``, and ``LeastTimeBasedMatchingStrategy`` demonstrate the use of this pattern, providing flexibility and scalability to the system. |
| 7 | + |
| 8 | +## Features |
| 9 | +- **Singleton Pattern**: Ensures a single instance of crucial manager classes such as `DriverMgr`, `RiderMgr`, `TripMgr`, and `StrategyMgr` for centralized management. |
| 10 | +- **Strategy Pattern**: Encapsulates algorithms for # and driver matching, providing flexibility and scalability. |
| 11 | +- **Modern C++17 Features**: Utilizes smart pointers (though introduced in C++11), STL containers, and thread-safe operations to build an efficient and maintainable system. |
| 12 | + |
| 13 | +## Prerequisites |
| 14 | +- **C++17 Compiler**: Ensure you have a C++17 compatible compiler installed (e.g., g++, clang++). |
| 15 | +- **CMake**: Ensure you have CMake installed on your system. |
| 16 | + |
| 17 | +## Steps to Run the Project |
| 18 | + |
| 19 | +1. **Clone the Repository** |
| 20 | + ```sh |
| 21 | + git clone https://github.com/piyush26c/Uber-Low-Level-Design.git |
| 22 | + cd Uber-Low-Level-Design |
| 23 | + ``` |
| 24 | + |
| 25 | +2. **Create a Build Directory** |
| 26 | + ```sh |
| 27 | + mkdir build |
| 28 | + cd build |
| 29 | + ``` |
| 30 | + |
| 31 | +3. **Generate the Build System using CMake** |
| 32 | + ```sh |
| 33 | + cmake .. |
| 34 | + ``` |
| 35 | + |
| 36 | +4. **Build the Project** |
| 37 | + ```sh |
| 38 | + make |
| 39 | + ``` |
| 40 | + |
| 41 | +5. **Run the Executable** |
| 42 | + ```sh |
| 43 | + ./UberSystem |
| 44 | + ``` |
| 45 | + |
| 46 | + |
| 47 | +## Project Structure |
| 48 | + |
| 49 | +```sh |
| 50 | +├── CMakeLists.txt |
| 51 | +├── common.hpp |
| 52 | +├── default#Strategy.hpp |
| 53 | +├── driver.hpp |
| 54 | +├── driverMatchingStrategy.hpp |
| 55 | +├── driverMgr.cpp |
| 56 | +├── driverMgr.hpp |
| 57 | +├── leastTimeBasedMatchingStrategy.hpp |
| 58 | +├── location.hpp |
| 59 | +├── main.cpp |
| 60 | +├── #Strategy.hpp |
| 61 | +├── ratingBased#Strategy.hpp |
| 62 | +├── rider.hpp |
| 63 | +├── riderMgr.cpp |
| 64 | +├── riderMgr.hpp |
| 65 | +├── strategyMgr.cpp |
| 66 | +├── strategyMgr.hpp |
| 67 | +├── trip.hpp |
| 68 | +├── tripMetaData.hpp |
| 69 | +├── tripMgr.cpp |
| 70 | +├── tripMgr.hpp |
| 71 | +``` |
| 72 | +## Class UML Diagram |
| 73 | + |
| 74 | +*Note: Click on image below to render it with better view.* |
| 75 | + |
| 76 | + |
| 77 | +## Badges |
| 78 | + |
| 79 | + |
| 80 | +  |
| 81 | +## Authors |
| 82 | + |
| 83 | +- [Piyush Rajendra Chaudhari](https://github.com/piyush26c) |
6 | 84 |
|
7 |
| - |
|
0 commit comments