Repository navigation
Releases: sashaNull/project2024
Release list
v3.1
v3
v2.1
v2
Phase 2 Writeup
Team Members:
- Sasha Nguyen
- Matthieu Perez
- Rebecca Metzman
Additional Tasks for Grading
In addition to implementing the tasks described above, your team should also write a brief report that includes the following:
The Additional Tasks that you would like graded for this phase. Please keep in mind that we will only grade three Additional Tasks for a group of three, and four Additional Tasks for a group of four. If you list more than that, the tasks that get graded will be decided at the grader’s discretion.
- 2.6
- 2.8
- 2.11 (1.10)
Changes Made to the Provided Code
2.1
Implemented a caching mechanism in the getContributorName method by adding a new private Map<String, String> contributorNameCache. The cache improves performance by storing previously retrieved contributor names, reducing the need for repeated network calls.
2.2
- Added validation checks to ensure that the
WebClient,login, andpasswordparameters are not null. - Added error handling for cases when the
WebClientcannot connect to the server, returns null, or provides malformed JSON data. - Updated methods to throw
IllegalStateExceptionorIllegalArgumentExceptionwhere appropriate to match the test cases. - UserInterface Class: Updated the
start,createFund, andmainmethods to handle exceptions.
2.3
- Added the class
ContributorAggregate.javato deal with aggregating donations. - Added a
displayAggregatedDonationmethod to theUIclass. - Added an
aggregatedDonationscache to store the aggregated donations.
2.6
- Added the method
getAggregatedDonations()to aggregate donations by fund, cache the results, and order them by total donation amount in descending order. - Updated the
onResume()method. - Created a new class to hold aggregate data for donations.
2.8
- Improved user prompts for commands like logging out.
- Added new methods for managing user sessions effectively.
2.11 (1.10)
- Added a
DateTimeFormatterfield calledformatterto change the format of the date displayed.
Known Bugs or Issues
List any known bugs or issues with the tasks you attempted in this phase.
Instructions
Instructions on how to start each app, if you changed anything from the original version of the code, e.g. the name of the Java main class or JavaScript entry point, arguments to the programs, etc. If you did not change anything, you may omit this.
Team Member Contributions
- Rebecca Metzman: Worked on 2.3 and 2.11 (which we did 1.10 for).
- Sasha Nguyen: Worked on 2.1 and 2.8.
- Matthieu Perez: Worked on 2.2 and 2.6.
The writeup should be committed to your GitHub repo as a plain-text or .md file named “Phase 2 writeup” by the deadline stated above.
v1
Group 10
Team Members:
- Rebecca Metzman
- Sasha Nguyen
- Matthieu Perez
Additional Tasks:
- 1.5
- 1.8
- 1.9
Descriptions of Changes:
1.1
- Added test cases / new test classes for the other methods.
1.2
- NA
1.3
- Changed the start function.
1.4
- Added a new variable to calculate the total amount of donations and display it.
1.5
- Added test cases / new test files for each method.
1.8
- Changed the
createFundmethod.
1.9
- Made
attemptLoginthrow anIllegalStateExceptionand added a try-catch block in themain()function of UI.
Bugs Found and Fixed:
1.5:
- Changed from direct
getmethod calls inattemptLogintooptStringandoptIntmethods to safely retrieve values from the JSON object. This resolves the issue where the method was expected to handle missing fields gracefully but did not do so. - Added a catch block specifically for
JSONExceptionto handle invalid JSON responses better. When aJSONExceptionis caught, the method now returns null instead of propagating the exception. - In
getFundName, added a check to verify if the response is a valid JSON object before attempting to parse it. If the response is not valid JSON, the method now handles it appropriately by logging the error and returning null. - In
getAllOrganizations, added a check to verify if the response is a valid JSON object before attempting to parse it. This helps handle cases where the response is not valid JSON, preventing theJSONException. - In
makeDonation, added a check to verify if the response is a valid JSON object before attempting to parse it.
Known Bugs or Issues:
- (Include any known bugs or issues here if applicable)
Instructions:
- (Include instructions on how to start each app, if anything was changed from the original version of the code. If nothing was changed, this section can be omitted.)
Team Member Contributions:
Rebecca Metzman
- Tasks: 1.1, 1.2, 1.5
Sasha Nguyen
- Tasks: 1.4, 1.9
Matthieu Perez
- Tasks: 1.3, 1.8