Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Herreray code review #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Herreray code review #4

wants to merge 3 commits into from

Conversation

Yep-Was-Taken
Copy link
Collaborator

Analysis of the program.
The program seems to be very similar to the individual assignment that we were working on, and is tailored to the project goal that they have set out for.
Was the program available in UC Github on time?
The project was pushed to their GitHub at the link they have provided, but I was not given access as a collaborator on time which is the reason for this later pull request.
Is the program easy for you, as an outsider, to understand?
It was easy for me to understand the intention of the project, which seems to be an application designed around ordering food from a restaurant’s menu.
Does the program compile?
Yes, the program compiled and completed the 3 tests designed by the team.

Three technical concepts learned:

  1. I learned more about how to format an exception message that also contains the elements of the request – by doing so it can be determined if the foodID or foodName are the root of a potential issue.
  2. I learned more about the way to go for reviewing code and how to leave constructive feedback. Through the use of direct code change (ideally through github) and leaving the commentary and explanation for the pull request field.
  3. I learned about the benefit and approach for practically using circuit breakers for greater fault tolerance. This would be useful in the step before the exception handling as more of a input tester to ensure that the data being sent has been tested to contain all necessary fields. Small checkpoints like this along the application are covered by this concept.

Sources used:
https://www.capitalone.com/tech/software-engineering/10-microservices-best-practices/
https://martinfowler.com/bliki/TechnicalDebt.html
https://rhamedy.medium.com/a-short-summary-of-java-coding-best-practices-31283d0167d3

Source: https://martinfowler.com/bliki/TechnicalDebt.html
When reviewing the code – in what has been tested the foodDescription and foodImage tags were not utilized in the project testing, so I removed them in an attempt to reduce current clutter.
Source: https://martinfowler.com/bliki/TechnicalDebt.html
In a method it is bad practice to declare unused variables.
Source: https://rhamedy.medium.com/a-short-summary-of-java-coding-best-practices-31283d0167d3
Using their recommendation of well indented exception messages that can better diagnose what went wrong.
}
return food;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Careful here. food is initialized to null, so what happens if an exception is thrown?
The exception is logged, and discarded, and then a null is returned.
That puts you in a worse off position, because you'll end up with an ambiguous NullPointerException later.
This is a case where it might be better to just allow the exception to be thrown, so that the calling method knows what happened.

Comment on lines -9 to +12
private int foodId;
private String foodId;
private String foodName;
private String foodCategory;
private String foodDescription;
private double foodPrice;
//Might need to create another class for this based off of what the professor has done in his project
//private MultipartFile foodImage;
private String foodCategory;
private double foodPrice;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the technical debt reduction here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants