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

Hometask 2 #2

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Hometask 2 #2

wants to merge 10 commits into from

Conversation

Daria-Volosatova
Copy link
Owner

No description provided.

Copy link
Collaborator

@a-ivanov a-ivanov left a comment

Choose a reason for hiding this comment

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

См. комментарии по 1му дз в #1. Поправьте их в той или в этой ветке сначала (здесь они не исправлены).

Copy link
Collaborator

@a-ivanov a-ivanov left a comment

Choose a reason for hiding this comment

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

Перечитайте дз 2, важная часть - внутренний итератор, сейчас его нет.

}

for (Room room : smartHome.getRooms()) {
for (Light light : room.getLights()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Этот цикл должен быть заменен на внутренний итератор по 2му заданию. Вся итерацию должны делать объекты дома, а не кто-то со стороны. Исправьте.

package ru.sbt.mipt.oop;

public interface Actionable {
String getId();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Нарушение SRP - единственная ответственность - execute(Action action). Исправьте.

if (!isDoorEvent(event)) {
return;
}
for (Room room : smartHome.getRooms()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Перенести цикл внутрь объектов дома.

Copy link
Collaborator

@a-ivanov a-ivanov left a comment

Choose a reason for hiding this comment

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

skypeforlinux-64.deb - что этот 75 мегабайтный файл делает в проекте?

@@ -21,4 +22,9 @@ public void addRoom(Room room) {
public Collection<Room> getRooms() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Этого метода не должно быть - вся итерация внутри void execute(Action action).

@@ -24,4 +24,9 @@ public Room(Collection<Light> lights, Collection<Door> doors, String name) {
public String getName() {
return name;
}

public void execute(Action action) {
action.executeObj(this);
Copy link
Collaborator

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