Conversation
| private void validatePlayerNumber(List<Integer> playerNumber) { | ||
| validateSize(playerNumber); | ||
| } | ||
|
|
||
| private void validateSize(List<Integer> playerNumber) { | ||
| if(playerNumber.size() != 3){ | ||
| throw new IllegalArgumentException("3자리를 입력 해야 합니다."); | ||
| } | ||
| } |
There was a problem hiding this comment.
validatePlayerNumber 메서드 내부에 직접 로직을 작성하시지않고 validateSize로 메서드 추출한 이유가 있을까요?
There was a problem hiding this comment.
예외가 2개 이상 작성하려다가 지우는걸 깜빡한거 같아요 ! 감사합니다
There was a problem hiding this comment.
재시도 역시 player의 입력에 해당하는 것인데 player domain에서 하지 않고 class를 모두 분리한 이유가 있을까요?
There was a problem hiding this comment.
안녕하세요 늦게 봐서 죄송해요.
제 생각은 Player domain에서 Retry값을 가지고 있다고 해도 그 값을 사용해서 뭔가 로직을 짤만한 생각이 안났어요!
근데, 생각해보면 논리적으로 Player가 Retry값을 가지고 있는게 맞는거 같기도 하네요??
| } | ||
|
|
||
| private Computer generateComputerNumber() { | ||
| return randomNumberGenerator.generate(); |
There was a problem hiding this comment.
Computer 도메인이 있는데 RandomNumberGenerator는 computer 작업이니 computerService로 두는 것에 대해서는 어떻게 생각하세요?
실제 컴퓨터가 제공하는 기능으로 보고 구분하는것은 어떤가 싶어서 코멘트 남깁니다!
There was a problem hiding this comment.
그 생각은 못했는데, Computer에 작업이니 Computer가 담당하게 하는게 나을거 같네요 감사합니다 😁
| @@ -0,0 +1,39 @@ | |||
| package baseball.domain; | |||
|
|
|||
| public class CountOfBalls { | |||
There was a problem hiding this comment.
Strike 카운트랑 Ball 카운트를 담당해주는 클래스라면 클래스 명을 CountOfBalls 말고 Strike까지 같이 담아주는 클래스명으로 지어보는 것이 어떨까요?
There was a problem hiding this comment.
제가 생각한 건 Strike와 ball의 카운트를 세는 Balls 였습니다.
근데 이 클래스 명은 오해할 소지가 있네요! 감사합니다.
No description provided.