Skip to content

Conversation

@Solomento
Copy link

No description provided.

src/Main.java Outdated
@@ -0,0 +1,2 @@
package PACKAGE_NAME;public class Main {
Copy link
Owner

Choose a reason for hiding this comment

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

?

import java.util.Iterator;
import java.util.List;

public class FamilyTree implements Serializable {
Copy link
Owner

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

Choose a reason for hiding this comment

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

Требуется создать класс Сервис для группировки работы модели. Модель это не только работа с деревом. Например в нашем проекте еще есть работа с файловой системой, с помощью которой мы делаем сохранения и загрузку

Comment on lines 18 to 19
do {
view.displayFamilyTree(model.getInfo());
Copy link
Owner

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 принципу солид

package presenter;
import java.util.Scanner;

public class prompt_user_input {
Copy link
Owner

Choose a reason for hiding this comment

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

Название классов всегда с большой буквы

Copy link
Owner

Choose a reason for hiding this comment

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

И CamelCase желательно

import java.util.Scanner;

public class prompt_user_input {
private Scanner scanner;
Copy link
Owner

Choose a reason for hiding this comment

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

Общение с пользователем это работа view части проекта, а не презентера, а я вижу, что данный класс находится в пакете презентера...


import java.util.Scanner;

public class FamilyTreeView {
Copy link
Owner

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

Choose a reason for hiding this comment

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

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

Comment on lines +77 to +86
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;
Copy link
Owner

Choose a reason for hiding this comment

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

Скорее это работа класса Дерево, а точней его метода toString

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