Open
Conversation
joswlv
requested changes
Feb 23, 2022
joswlv
left a comment
There was a problem hiding this comment.
안녕하세요 민상님!
몇 가지 코멘트를 남겼습니다.
확인 부탁드립니다.
| import blackjack.domain.report.GameResult; | ||
| import blackjack.domain.report.GameReport; | ||
|
|
||
| public class Dealer extends Player { |
There was a problem hiding this comment.
딜러와 참가자의 공통 속성을 추상화하는 방향으로 수정해보는 것은 어떨까요?
참고 자료
https://tecoble.techcourse.co.kr/post/2020-05-18-inheritance-vs-composition/
| } | ||
|
|
||
| public List<Card> getCards() { | ||
| return Collections.unmodifiableList(cards); |
There was a problem hiding this comment.
Suggested change
| return Collections.unmodifiableList(cards); | |
| return new ArrayList<>cards); |
Collections.unmodifiableList는 방어적 복사가 되지 않습니다.
참고 자료
| Set<Card> removeDuplicates = new HashSet<>(cards); | ||
| assertThat(removeDuplicates.size()).isEqualTo(52); | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
파일 마지막은 개행을 해주는 것이 컨벤션입니다.
https://blog.coderifleman.com/2015/04/04/text-files-end-with-a-newline/
|
|
||
| import java.util.Objects; | ||
|
|
||
| public class Card { |
There was a problem hiding this comment.
Card를 static하게 만들어 보는 것은 어떨까요?
이전 로또미션의 로또넘버 객체와 같은 원리 입니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.