-
Notifications
You must be signed in to change notification settings - Fork 63
homework lesson1 #13
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
base: master
Are you sure you want to change the base?
homework lesson1 #13
Conversation
| public enum Gender { | ||
| MALE, FEMALE; | ||
| }; |
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.
Лучше в отдельном файле
| private Calendar dob, dod; | ||
| private Human mother; | ||
| private Human father; | ||
| private final Gender gender; |
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.
Странно, что только это поле final ))
| service.sortByAge(); | ||
| getFullList(); | ||
| } | ||
|
|
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.
Добавить методы сохранения и загрузки
| } | ||
|
|
||
| public void addHuman(String name, String surname, GregorianCalendar dob, Human.Gender gender, Integer mother, Integer father) { | ||
| Human hm = new Human(name, surname, dob, gender, fl.getHumanByIndex(mother), fl.getHumanByIndex(father)); |
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.
Лучше было бы сделать проверку. Вдруг id родителя не соответствует ни одной записи. Тогда надо сообщить о проблеме, прежде чем создавать новую запись
| while (status) { | ||
| System.out.println("1. Add student"); | ||
| System.out.println("2. Get full family list"); |
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.
Нарушает второй принцип солид. При попытке добавления нового функционала придется переписывать метод
|
|
||
| public class Service { | ||
| FamilyList<Human> fl; | ||
| private FileHandlerList fhl; |
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.
нарушает пятый принцип солид. Зависимость должна быть от абстракции
No description provided.