Conversation
greeng00se
left a comment
There was a problem hiding this comment.
정성스럽게 리뷰 남겨주셔서 감사합니다!
좋은 하루 되세요 CFalws님 😄
| public BallNumber getNumber() { | ||
| return number; | ||
| } | ||
| } |
There was a problem hiding this comment.
Position을 따로 만들어준게 인상깊어요 👍
다만 클래스명이 볼카운트의 볼과 동일하여 혼동의 여지가 있을 것 같아요!
There was a problem hiding this comment.
별 생각없이 이름 지었는데 Ball, Strike를 표현하는 객체로 오인할 수 있겠네요:)
| } | ||
| return ballNumber; | ||
| } | ||
|
|
There was a problem hiding this comment.
정적 팩터리 메서드를 볼 때 생성자를 호출하는 부분이 validate를 위한게 아니라 인스턴스를 생성한다는 느낌을 받았어요!
hashMap에서 값을 가져오기 전에 validate 메서드를 호출 하는건 어떨까요?
There was a problem hiding this comment.
처음에 그렇게 했는데
특이해보이면 더 좋아보이는 습성이 또 발동했던 것 같네요ㅋㅋㅋ
덕분에 인스턴스 캐싱의 장점을 많이 느낄 수 있었습니다👍
| } | ||
| return new ArrayList<>(uniqueNumbers); | ||
| } | ||
|
|
There was a problem hiding this comment.
Streamg.generate를 사용한다면 조금 더 간단하게 메서드를 작성할 수 있을 것 같아요!
There was a problem hiding this comment.
메서드 이름도 잘못지었네요😂
hasNotEnough인데..ㅋㅋ
감사합니다!
| GameResult.of(0, 0) | ||
| ) | ||
| ); | ||
| } |
There was a problem hiding this comment.
테스트 전용 메서드를 만들어 중복되는 부분을 제거할 수 있을 것 같아요!
List<Balls> generateBall(List<Integer> numbers) {
return IntStream.range(0, 3)
.mapToObj(i -> new Ball(BallNumber.valueOf(numbers.get(i)), Position.valueOf(i)))
.collect(toList());
}| outputView = new OutputView(); | ||
| } | ||
| return outputView; | ||
| } |
No description provided.