-
Notifications
You must be signed in to change notification settings - Fork 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
[백지현] 1차 과제 제출 #11
base: develop
Are you sure you want to change the base?
[백지현] 1차 과제 제출 #11
Conversation
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.
좋은 코드 감사합니다 !
} | ||
} | ||
|
||
private void decreaseSellIn(Item item) { |
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.
decreaseSellIn 메서드랑 increaseQuality 메서드가 중복되니 부모 클래스에 구현하고 자식클래스에서 상속받아서 사용해도 좋을 것 같습니다 😊
} | ||
} | ||
} | ||
for (Item item : items) { |
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.
향상된 for문으로 변경돼서 더 가독성이 좋네요 👍
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.
팩토리 메소드 패턴을 사용해 작성한 코드 인상깊게 읽었습니다!
} | ||
} | ||
for (Item item : items) { | ||
Logic logic = LogicFactory.getLogic(item); |
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.
팩토리 메소드를 활용 해 OCP를 지키는 코드를 짜신 것이 인상 깊었습니다! 다만LogicFactory나 getLogic 같은 클래스명, 메소드명은 이름을 통해 어떤 내용인지 유추하기 어려운 것 같습니다. ItemUpdateLogic
같이 명확한 메소드를 사용하는 것은 어떨까요?
|
||
private void decreaseQualityTwice(Item item) { | ||
if (item.quality > 0) { | ||
item.quality = Math.max(0, item.quality - 2); |
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.
if문을 한번 더 사용하는 것이 아닌 Math.max 메소드를 통해 quality를 결정하는 방식 좋습니다!
No description provided.