The Palos Publishing Company

Follow Us On The X Platform @PalosPublishing
Categories We Write About

Design a Campus Shuttle Bus Live Tracking App Using OOD Principles

Overview

The Campus Shuttle Bus Live Tracking App helps students, faculty, and staff to track shuttle buses in real-time across a campus. The app aims to offer the following key features:

  • Live bus tracking with GPS updates.

  • Shuttle bus schedules and routes.

  • Push notifications for shuttle arrival alerts.

  • User profiles for personalized services (e.g., favorite shuttle routes).

  • A web-based or mobile interface.

The system design will utilize Object-Oriented Design (OOD) principles for a flexible, maintainable, and extensible solution.


1. Key Use Cases

  • Student/Faculty: Track shuttle locations in real-time, view schedules, receive notifications.

  • Administrator: Add or modify shuttle schedules, monitor shuttle performance.

  • Shuttle Bus Driver: Update bus location manually in case of issues with automatic GPS tracking.

  • System: Provide accurate GPS location updates, manage shuttle schedules, and process notifications.


2. Object-Oriented Design Principles

We’ll use the following OOD principles to structure the system:

  • Encapsulation: Hide the internal workings of shuttle and user objects; only expose necessary methods.

  • Inheritance: Allow different shuttle types (e.g., electric, traditional) to inherit from a common shuttle class.

  • Polymorphism: Define methods in the shuttle classes that behave differently depending on the shuttle type.

  • Abstraction: Simplify the interactions by using interfaces for tracking, notifications, and user profiles.


3. Class Design

3.1. Main Classes

  • User Class
    Represents a user of the app, such as a student or administrator.

    Attributes:

    • user_id: Unique ID for the user.

    • name: User’s name.

    • email: User’s email address.

    • user_type: Type of user (student, faculty, admin).

    Methods:

    • view_schedule(): Displays available shuttle schedules.

    • set_alerts(): Allows the user to set alerts for shuttle arrival.

    • track_shuttle(): Tracks a particular shuttle bus in real-time.


  • Shuttle Class
    Represents a shuttle bus, storing information such as location, bus ID, route, and status.

    Attributes:

    • bus_id: Unique ID for the shuttle bus.

    • location: Current GPS coordinates.

    • route: Route the shuttle is following.

    • status: Current status of the bus (e.g., on-time, delayed).

    • next_stop: The next scheduled stop for the bus.

    Methods:

    • update_location(): Updates the current GPS location.

    • get_status(): Returns the shuttle’s current status.

    • update_status(): Changes the shuttle’s status (e.g., on-time, delayed).


  • Route Class
    Represents the route a shuttle follows, including the list of stops.

    Attributes:

    • route_id: Unique identifier for the route.

    • stops[]: List of scheduled stops along the route.

    • schedule: Timetable of when buses should arrive at each stop.

    Methods:

    • get_schedule(): Returns the list of scheduled bus arrival times for each stop.

    • add_stop(): Adds a new stop to the route.

    • remove_stop(): Removes a stop from the route.


  • Location Class
    Handles all location-related functionality for shuttle tracking.

    Attributes:

    • latitude: Latitude of the shuttle’s current location.

    • longitude: Longitude of the shuttle’s current location.

    • timestamp: Time when the location was last updated.

    Methods:

    • get_distance(): Calculates distance from the current location to a given stop or campus landmark.

    • get_location(): Returns the current GPS coordinates.


  • Notification Class
    Used for sending push notifications or alerts.

    Attributes:

    • notification_id: Unique identifier for the notification.

    • message: The message of the notification.

    • user: The user to whom the notification is sent.

    Methods:

    • send_notification(): Sends a notification to a user.

    • schedule_notification(): Schedules notifications for specific times, such as shuttle arrival.


  • Admin Class
    The administrator can manage bus schedules, routes, and users.

    Attributes:

    • admin_id: Unique admin ID.

    • shuttle_list[]: List of all shuttles.

    • route_list[]: List of all shuttle routes.

    Methods:

    • add_shuttle(): Adds a new shuttle bus to the system.

    • edit_shuttle_schedule(): Modifies shuttle schedules.

    • view_reports(): Provides reports on shuttle performance and user feedback.


4. Interaction Between Classes

  • User-Route-Shuttle Interaction:
    A user requests to track a shuttle by choosing a route and a shuttle. The system uses the Shuttle class to fetch the bus’s real-time location via the Location class. The app updates the user with the latest status and position of the shuttle.

  • Admin-Shuttle Management:
    Admins use the Admin class to modify shuttle schedules by editing the Route class. If a new shuttle is added to the system, the admin updates the list of available shuttles using the Shuttle class.

  • Notification System:
    Notifications are triggered based on user preferences or shuttle status updates. For instance, if a shuttle is approaching a user’s location, the Notification class sends an alert through the system.


5. Design Patterns Utilized

  • Observer Pattern:
    The app can implement the Observer pattern when users subscribe to real-time shuttle updates. When a shuttle’s location or status changes, all subscribed users (observers) are notified.

  • Singleton Pattern:
    The Notification class can be a singleton to ensure that only one instance manages all notifications, preventing duplication.

  • Strategy Pattern:
    Used for handling different notification strategies (e.g., push notifications, SMS) or shuttle routing algorithms based on time of day or user preference.


6. Database Design

The database stores information about users, shuttles, routes, schedules, and notifications.

Entities:

  • Users: Stores user credentials and preferences.

  • Shuttles: Stores shuttle bus details, including routes and locations.

  • Routes: Stores route details and stops.

  • Notifications: Stores notifications to be sent to users.


7. Scalability Considerations

  • Microservices Architecture:
    As the system grows, microservices can be used for separating different functionalities like notification management, user management, and shuttle tracking.

  • Cloud-based GPS Tracking:
    Use cloud-based services for GPS tracking to allow scalability and reliable real-time data.

  • Database Optimization:
    Use database indexing and caching techniques to ensure real-time shuttle location updates are fast and efficient.


8. UI/UX Design

  • Mobile Interface:

    • Map-based interface showing the real-time shuttle location.

    • Easy-to-use schedule view for users to check shuttle arrival times.

    • Push notification settings for users to customize shuttle arrival alerts.

  • Admin Dashboard:

    • A simple dashboard to manage shuttle routes and schedules.

    • Tools for viewing real-time data of shuttle locations.


9. Technologies

  • Frontend:

    • React Native or Flutter for mobile app development.

    • Google Maps API for real-time shuttle tracking.

  • Backend:

    • Node.js or Django for building RESTful APIs.

    • Redis for caching shuttle location data.

    • PostgreSQL or MongoDB for database management.


Conclusion

This Campus Shuttle Bus Live Tracking App designed with OOD principles ensures that the system is flexible, scalable, and easy to maintain. By using encapsulation, inheritance, and other OOD principles, the app will be able to handle various user types, shuttle types, and complex features like real-time tracking and notifications.

Share this Page your favorite way: Click any app below to share.

Enter your email below to join The Palos Publishing Company Email List

We respect your email privacy

Categories We Write About