Assignment1 abid nahian chowdhury #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addressed Issue:
Addressed notification and social media subsystems, improving their efficiency and maintainability. Specifically, it resolves redundant code and enhances data handling processes.
What I Have Reengineered
Notification Dispatch System:
Refactored logic for sending SMS messages to responders, eliminating redundant loops.
Added improved exception handling for API requests to the dispatchnotices endpoint.
Social Media Announcement Generator:
Optimized payloads for Facebook and Twitter announcements.
Reduced redundancy in creating crisis-related information.
Simplified the WebSocket broadcasting code and reduced redundant code.
Grouped reusable logic into helper functions.
Reengineering Strategy or Approach Used
Removing Redundant Code:
Extracted repetitive data processing (e.g., crisis description, type, and assistance formatting) into helper functions, improving maintainability.
Error Handling:
Enhanced exception handling around API calls.
Performance Improvement:
Reduced redundant loops and database queries to improve the speed.
Impact of Changes
Performance Gains:
Streamlined processing and reduced redundant steps, enhancing the system's response time.
Improved Maintainability:
The refactored code is modular, easier to understand, and aligns better with Django’s design principles.
Enhanced User Experience:
Notifications and social media posts are now consistently formatted and generated more efficiently.