-
Notifications
You must be signed in to change notification settings - Fork 18
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
base: master
Are you sure you want to change the base?
Conversation
return null; | ||
} | ||
|
||
private void setPetType(Pet pet, String csv){ |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
No description provided.