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

[백지현] 1차 과제 제출 #11

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

qormoon
Copy link

@qormoon qormoon commented Oct 2, 2024

No description provided.

Copy link
Member

@u-genuine u-genuine left a comment

Choose a reason for hiding this comment

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

좋은 코드 감사합니다 !

}
}

private void decreaseSellIn(Item item) {
Copy link
Member

Choose a reason for hiding this comment

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

decreaseSellIn 메서드랑 increaseQuality 메서드가 중복되니 부모 클래스에 구현하고 자식클래스에서 상속받아서 사용해도 좋을 것 같습니다 😊

}
}
}
for (Item item : items) {
Copy link
Member

Choose a reason for hiding this comment

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

향상된 for문으로 변경돼서 더 가독성이 좋네요 👍

Copy link
Member

@gikhoon gikhoon left a comment

Choose a reason for hiding this comment

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

팩토리 메소드 패턴을 사용해 작성한 코드 인상깊게 읽었습니다!

}
}
for (Item item : items) {
Logic logic = LogicFactory.getLogic(item);
Copy link
Member

Choose a reason for hiding this comment

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

팩토리 메소드를 활용 해 OCP를 지키는 코드를 짜신 것이 인상 깊었습니다! 다만LogicFactory나 getLogic 같은 클래스명, 메소드명은 이름을 통해 어떤 내용인지 유추하기 어려운 것 같습니다. ItemUpdateLogic 같이 명확한 메소드를 사용하는 것은 어떨까요?


private void decreaseQualityTwice(Item item) {
if (item.quality > 0) {
item.quality = Math.max(0, item.quality - 2);
Copy link
Member

Choose a reason for hiding this comment

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

if문을 한번 더 사용하는 것이 아닌 Math.max 메소드를 통해 quality를 결정하는 방식 좋습니다!

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.

3 participants