Design of a Smart Public Transit Feedback App Using Object-Oriented Design (OOD)
The goal of this project is to design a Smart Public Transit Feedback App that allows users to share their feedback on public transit services (buses, trains, etc.) in real time. The app will be built using Object-Oriented Design principles, which will help in creating a modular, reusable, and maintainable system.
Core Functionalities of the Smart Public Transit Feedback App:
-
User Feedback Submission:
-
Users should be able to submit feedback on various aspects of the transit service (e.g., punctuality, cleanliness, comfort, safety).
-
Feedback will include ratings (stars or points) and comments.
-
Users can also flag specific issues such as overcrowding or delayed services.
-
-
Real-Time Tracking:
-
Users should be able to view real-time information on buses, trains, or other modes of transport, including their current location and estimated arrival times.
-
Users can submit feedback on the real-time transit experience, including whether they arrived on time or had a smooth journey.
-
-
Admin Dashboard:
-
A dashboard for transit authorities to manage feedback, view aggregated data, and address customer concerns.
-
The admin will have the ability to flag recurring issues and prioritize responses.
-
-
Personalization:
-
The app can store users’ transit preferences, such as their usual routes, favorite stations, and specific feedback history.
-
Notifications can be customized based on users’ routes or past experiences.
-
Object-Oriented Design (OOD) Concepts:
In Object-Oriented Design, we will define the main classes, objects, and their relationships. The primary goal is to break down the problem into smaller, manageable components. The key objects for this system include:
1. User
-
The User class will represent an individual using the app to provide feedback on public transit services.
Attributes:
-
userID: A unique identifier for each user. -
name: The user’s name. -
email: Contact email for user notifications. -
preferredRoutes: List of routes the user frequently uses. -
feedbackHistory: A list storing the user’s past feedback on different transit services.
Methods:
-
submitFeedback(feedback: Feedback): Method to submit feedback on transit services. -
viewFeedback(): Allows the user to view their past feedback and ratings. -
getNotifications(): Displays relevant notifications based on the user’s routes or preferences.
2. Feedback
-
The Feedback class captures the data for each piece of feedback submitted by the user.
Attributes:
-
feedbackID: Unique ID for the feedback entry. -
transitType: Type of public transit (e.g., bus, subway, train). -
rating: Rating given by the user (1 to 5 stars). -
comments: A textual review or comments provided by the user. -
issueFlag: A boolean or list to flag issues like delay or overcrowding.
Methods:
-
editFeedback(newComments: String, newRating: int): Allows the user to edit their feedback. -
displayFeedback(): Displays feedback details, including rating and comments.
3. TransitService
-
The TransitService class will manage the details related to the transit service (e.g., bus or train).
Attributes:
-
serviceID: Unique identifier for each transit service. -
routeName: The name or ID of the route (e.g., Route 12). -
status: The current status of the service (e.g., on time, delayed). -
estimatedArrival: Estimated arrival time at a given station.
Methods:
-
updateStatus(status: String): Allows updating the status of the transit service (e.g., running late, on time). -
updateLocation(location: String): Updates the current location of the transit service (e.g., halfway to station X).
4. Admin
-
The Admin class is used to manage and view all feedback submitted by users and to address recurring issues.
Attributes:
-
adminID: Unique identifier for the admin. -
adminName: Admin’s name. -
managedRoutes: Routes that the admin is responsible for managing.
Methods:
-
viewAllFeedback(): Retrieves all feedback for the routes managed by the admin. -
resolveIssue(feedbackID: String): Mark a particular issue as resolved after addressing user complaints. -
sendResponse(userID: String, message: String): Sends a message to the user addressing their feedback.
5. Notification
-
The Notification class will handle notifying users about their feedback status, updates on their routes, or responses from the admin.
Attributes:
-
notificationID: Unique ID for the notification. -
message: The content of the notification (e.g., feedback response or transit alert). -
timestamp: When the notification was generated.
Methods:
-
sendNotification(userID: String): Sends a notification to a specific user. -
viewNotifications(): Allows the user to view their list of notifications.
6. Route
-
The Route class will define each public transit route.
Attributes:
-
routeID: Unique identifier for the route. -
routeName: Name or ID of the route. -
stations: List of stations that are part of this route. -
totalStops: Number of stops on this route.
Methods:
-
addStation(station: String): Add a new station to the route. -
removeStation(station: String): Remove a station from the route. -
getRouteDetails(): Get the full list of stations and stops.
Relationships Between Classes:
-
User will interact with Feedback to submit their reviews and check their feedback history.
-
User will interact with TransitService to track real-time updates on routes.
-
Admin will interact with Feedback to resolve issues and manage feedback responses.
-
Admin will interact with TransitService to update service status or monitor route performance.
-
Notification will interact with User and Admin to notify them of important events or updates.
Use Case Example:
-
User submits feedback:
-
A user opens the app, selects a recent bus ride, and submits feedback with a 4-star rating and comments about the bus being delayed. The feedback is recorded under the Feedback class.
-
-
Admin resolves issue:
-
The admin reviews the feedback via the admin dashboard. They see the delay issue marked as recurring and decide to notify the user about the resolution. The Admin class updates the status and sends a Notification to the user.
-
-
User receives notifications:
-
The user receives a notification about the status of the bus route, with an update on why there was a delay and a resolution.
-
Conclusion:
This design provides a scalable, modular, and maintainable system by breaking down the problem into discrete, self-contained objects. It follows object-oriented principles such as encapsulation, inheritance, and polymorphism, ensuring that each class handles its own specific responsibility while remaining flexible for future improvements or feature additions.