-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
숫자 야구 코드 리뷰용 #1
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.
정성스럽게 리뷰 남겨주셔서 감사합니다!
좋은 하루 되세요 CFalws님 😄
public BallNumber getNumber() { | ||
return number; | ||
} | ||
} |
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.
Position을 따로 만들어준게 인상깊어요 👍
다만 클래스명이 볼카운트의 볼과 동일하여 혼동의 여지가 있을 것 같아요!
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.
별 생각없이 이름 지었는데 Ball, Strike를 표현하는 객체로 오인할 수 있겠네요:)
} | ||
return ballNumber; | ||
} | ||
|
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.
정적 팩터리 메서드를 볼 때 생성자를 호출하는 부분이 validate를 위한게 아니라 인스턴스를 생성한다는 느낌을 받았어요!
hashMap에서 값을 가져오기 전에 validate 메서드를 호출 하는건 어떨까요?
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.
처음에 그렇게 했는데
특이해보이면 더 좋아보이는 습성이 또 발동했던 것 같네요ㅋㅋㅋ
덕분에 인스턴스 캐싱의 장점을 많이 느낄 수 있었습니다👍
} | ||
return new ArrayList<>(uniqueNumbers); | ||
} | ||
|
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.
Streamg.generate를 사용한다면 조금 더 간단하게 메서드를 작성할 수 있을 것 같아요!
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.
메서드 이름도 잘못지었네요😂
hasNotEnough인데..ㅋㅋ
감사합니다!
GameResult.of(0, 0) | ||
) | ||
); | ||
} |
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.
테스트 전용 메서드를 만들어 중복되는 부분을 제거할 수 있을 것 같아요!
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; | ||
} |
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.
Lazy 👍
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.
크.. 칭찬 감사합니다
No description provided.