-
Notifications
You must be signed in to change notification settings - Fork 63
HW2.1 #14
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?
HW2.1 #14
Conversation
src/Main.java
Outdated
| @@ -0,0 +1,2 @@ | |||
| package PACKAGE_NAME;public class Main { | |||
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.
?
src/family_tree/FamilyTree.java
Outdated
| import java.util.Iterator; | ||
| import java.util.List; | ||
|
|
||
| public class FamilyTree implements Serializable { |
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.
Здесь по заданию ожидался интерфейс Iterable
| import view.FamilyTreeView; | ||
|
|
||
| public class FamilyTreePresenter { | ||
| private final FamilyTree<Human> model; |
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.
Требуется создать класс Сервис для группировки работы модели. Модель это не только работа с деревом. Например в нашем проекте еще есть работа с файловой системой, с помощью которой мы делаем сохранения и загрузку
| do { | ||
| view.displayFamilyTree(model.getInfo()); |
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.
Цикл перенести во view. Вы путаете с mvc. Например, если изменится view, то придется и презентер переписывать, что конечно же неправильно. Данный код не проходит по 1 и 2 принципу солид
src/presenter/prompt_user_input.java
Outdated
| package presenter; | ||
| import java.util.Scanner; | ||
|
|
||
| public class prompt_user_input { |
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.
Название классов всегда с большой буквы
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.
И CamelCase желательно
src/presenter/prompt_user_input.java
Outdated
| import java.util.Scanner; | ||
|
|
||
| public class prompt_user_input { | ||
| private Scanner scanner; |
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.
Общение с пользователем это работа view части проекта, а не презентера, а я вижу, что данный класс находится в пакете презентера...
src/view/FamilyTreeView.java
Outdated
|
|
||
| import java.util.Scanner; | ||
|
|
||
| public class FamilyTreeView { |
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.
Желательно все таки создать интерфейс будет к следующему дз. В соответствии с 5 принципом солид
|
|
||
| public class Service { | ||
| public FamilyTree<Human> familyTree; | ||
| public FileHandler fileHandler; |
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 String printFamilyTree() { | ||
| StringBuilder strBuilder = new StringBuilder(); | ||
| strBuilder.append("Family tree:"); | ||
| strBuilder.append("\n"); | ||
| for (Human human : familyTree) { | ||
| strBuilder.append(human); | ||
| strBuilder.append("\n"); | ||
| return strBuilder.toString(); | ||
| } | ||
| return null; |
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.
Скорее это работа класса Дерево, а точней его метода toString
No description provided.