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

refactor class group5 #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

madurner
Copy link

@madurner madurner commented Sep 7, 2021

No description provided.

return null;
}

private void setPetType(Pet pet, String csv){

Choose a reason for hiding this comment

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

I like that you kept the indentations small throughout this class, maybe except in this method and in removePetFromClinic. If the indentations get too far, try to extract the loop- or if-bodies :)


} while (i < csv.length() && pet != null);
private String readNextField(String csvString) {

Choose a reason for hiding this comment

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

nice to have a different solution how to parse this (not splitting the string) :)

List<Pet> pets = new LinkedList<Pet>();
Pet pet;
boolean petInformationAvailable;

Choose a reason for hiding this comment

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

this method is maybe still a bit long (maybe because of time reasons)..think about extracting the different steps to a new method, so importPets only handles the http request, there is another method that handles the orchestration of parsing and saving data, and then there are multiple methods for parsing stuff and so on

@@ -26,114 +27,156 @@
@Autowired
private ClinicService clinicService;

private int currentPosition;

Choose a reason for hiding this comment

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

I guess you cannot know this but with this class variable you add 'state' to the class...before that, this controller and the importPets method were stateless

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.

3 participants