Skip to content
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

Added functionality according to assignment specifications #1

Merged
merged 2 commits into from
Dec 7, 2024

Conversation

Walkthroughcoding
Copy link
Owner

  1. Add interface HistoryManager
  2. Add linked list algorithm in InMemoryHistoryManager
  3. Add tests for InMemoryHistoryManager

@Walkthroughcoding Walkthroughcoding merged commit ceaa00b into main Dec 7, 2024
1 check passed
2. Add interface HistoryManager
3. Add linked list algorithm in InMemoryHistoryManager
4. Add tests for InMemoryHistoryManager
Copy link

@EugeneLenkevich EugeneLenkevich left a comment

Choose a reason for hiding this comment

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

Привет, Егор, спасибо за присланное решение

Все верно, один моментик по коду

И второй моментик - ПР уже смержен в основную ветку. Надо сначала чтобы ПР прошел ревью, а затем уже мержить, так это работает по стандартном процессу и вообще весь смысл именно в этом, откати, пожалуйста, эти изменения в основной ветке (revert commit) и сделай ПР заново :)

@@ -19,7 +18,7 @@ public class InMemoryTaskManager implements TaskManager {
private Map<Integer, EpicTask> epicData = new HashMap<>();
private Map<Integer, Subtask> subtaskData = new HashMap<>();

private final List<Task> history = new ArrayList<>();
private final HistoryManager historyManager = new InMemoryHistoryManager();

Choose a reason for hiding this comment

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

А давай все таки создадим класс Managers в котором будут методы

  • TaskManager getDefault()
  • HistoryManager getDefaultHistory()
    и все места создания обоих менеджеров через new заменим на вызовы соответствующих методов из списка выше.

Что нам это даст:

  • далее, мы будем добавлять реализации менеджеров и, в теории, при смене реализации не надо будет менять сопутствующий код, например тесты, в которых мы создаем менеджер (задач или истории) как переменную с типом абстрактного интерфейса. По идее ради этого все и затевается :)

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