Skip to content

Conversation

@andrey-salokhin
Copy link

No description provided.

Comment on lines 8 to 10
public enum Gender {
MALE, FEMALE;
};
Copy link
Owner

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;
Copy link
Owner

Choose a reason for hiding this comment

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

Странно, что только это поле final ))

service.sortByAge();
getFullList();
}

Copy link
Owner

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));
Copy link
Owner

Choose a reason for hiding this comment

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

Лучше было бы сделать проверку. Вдруг id родителя не соответствует ни одной записи. Тогда надо сообщить о проблеме, прежде чем создавать новую запись

Comment on lines 22 to 24
while (status) {
System.out.println("1. Add student");
System.out.println("2. Get full family list");
Copy link
Owner

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;
Copy link
Owner

Choose a reason for hiding this comment

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

нарушает пятый принцип солид. Зависимость должна быть от абстракции

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.

2 participants