The Palos Publishing Company

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

Design a Smart Street Cleaning Schedule Notification App Using OOD Principles

Introduction

Designing a Smart Street Cleaning Schedule Notification App can bring convenience to urban residents and improve the efficiency of municipal services. The app’s primary purpose is to notify users about upcoming street cleaning schedules in their local areas, so they can move their vehicles and avoid fines. It should provide real-time notifications, reminders, and allow users to manage preferences.

This system will be designed using Object-Oriented Design (OOD) principles to ensure scalability, maintainability, and clarity.


Requirements

  • User Profile Management: Users need to register, login, and update their personal details.

  • Street Cleaning Schedule Notification: Provide accurate and timely notifications based on the user’s location.

  • User Preferences: Users can set preferences for when and how they receive notifications (e.g., via push notifications or email).

  • Map Integration: Display the street cleaning schedules on an interactive map.

  • Admin Panel: A dashboard for municipal authorities to input and manage cleaning schedules.

  • Real-Time Updates: Allow for schedule changes or cancellations to be reflected in real-time for the users.


Key Components and Classes

1. User Class

This class will store and manage information about the app’s users.

  • Attributes:

    • user_id: Unique identifier for each user.

    • name: User’s name.

    • email: User’s email address.

    • address: User’s residential address.

    • preferred_notification_method: How the user prefers to receive notifications (e.g., SMS, push, or email).

    • preferred_time: The time of day the user prefers notifications (morning, afternoon, etc.).

  • Methods:

    • register(): Registers the user with basic details.

    • update_preferences(): Allows the user to update their notification preferences.

    • get_notifications(): Retrieves a list of scheduled notifications.


2. Street Class

This class represents individual streets and their cleaning schedules.

  • Attributes:

    • street_id: Unique identifier for the street.

    • street_name: Name of the street.

    • cleaning_schedule: A list of dates and times for street cleaning.

    • location: Geographical location (latitude, longitude) of the street.

  • Methods:

    • add_schedule(): Allows an administrator to add a cleaning schedule for the street.

    • get_cleaning_schedule(): Returns the next cleaning dates for the street.

    • update_schedule(): Updates the cleaning schedule for the street.


3. Notification Class

This class will handle sending notifications to users.

  • Attributes:

    • notification_id: Unique identifier for each notification.

    • notification_type: Type of notification (e.g., push, email, SMS).

    • message: The actual content of the notification.

    • timestamp: The date and time when the notification is scheduled to be sent.

  • Methods:

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

    • schedule_notification(): Schedules a notification to be sent at a specific time.

    • cancel_notification(): Cancels a scheduled notification.


4. Admin Class

This class is for administrators who manage the system’s street cleaning schedules.

  • Attributes:

    • admin_id: Unique identifier for the administrator.

    • name: Admin’s name.

    • email: Admin’s email address.

  • Methods:

    • create_street_cleaning_schedule(): Adds a new cleaning schedule to the system.

    • update_street_cleaning_schedule(): Updates existing street cleaning schedules.

    • delete_street_cleaning_schedule(): Removes a street cleaning schedule from the system.


5. Map Class

This class integrates an interactive map feature for users to view street cleaning schedules visually.

  • Attributes:

    • map_id: Unique identifier for the map.

    • location: Geographical area (latitude, longitude).

    • street_list: List of streets shown on the map.

  • Methods:

    • display_map(): Displays an interactive map showing streets with upcoming cleaning schedules.

    • zoom_in(): Zooms in on a particular area on the map.

    • zoom_out(): Zooms out from a particular area on the map.


OOD Design Principles Applied

  1. Encapsulation: Each class (User, Street, Notification, Admin, Map) encapsulates its data and behaviors. For instance, the User class manages user-specific data, while the Notification class handles notification processes.

  2. Abstraction: The system hides complex implementation details by providing clear methods for interacting with objects. Users don’t need to know how notifications are sent; they just interact with methods like send_notification().

  3. Inheritance: If the system needs to expand in the future, we could create subclasses. For instance, Admin could be extended to SuperAdmin, who has additional permissions.

  4. Polymorphism: Different types of notifications (SMS, email, push) can be handled through a common interface. The Notification class could have different methods for each type, allowing flexibility in how notifications are delivered.


Sequence Diagram for Notification Process

  1. User logs in:

    • User calls register() to sign up and update_preferences() to set their notification preferences.

  2. Admin schedules street cleaning:

    • Admin calls create_street_cleaning_schedule() to schedule cleaning.

  3. System generates notifications:

    • The Notification class will generate a notification using schedule_notification() and set it to be sent at the specified time.

  4. User receives notification:

    • The system uses the send_notification() method to notify users according to their preferred method.


Use Case

  1. User Registers for Notifications:

    • A new user signs up with their details and sets their notification preferences (e.g., prefers SMS notifications for street cleaning).

  2. Admin Adds Street Cleaning Schedule:

    • An admin inputs the cleaning schedule for a specific street on the platform.

  3. System Sends Notification:

    • On the day of the street cleaning, the system sends a reminder to the users who are registered for that street.

  4. User Adjusts Preferences:

    • A user decides to change the notification time or method through the app’s settings.


Database Design (Sample Schema)

  1. Users Table:

    • user_id, name, email, address, preferred_notification_method, preferred_time

  2. Streets Table:

    • street_id, street_name, location

  3. Cleaning Schedules Table:

    • schedule_id, street_id, date, time

  4. Notifications Table:

    • notification_id, user_id, schedule_id, notification_type, message, timestamp


Conclusion

This design focuses on making a scalable and user-friendly street cleaning notification system. By applying object-oriented principles, the app ensures modularity, reusability, and maintainability. Users will benefit from personalized notifications, and the system allows administrators to manage schedules with ease.

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