-
Notifications
You must be signed in to change notification settings - Fork 4
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
[Level3] 김은비 학습 PR제출합니다 #16
base: main
Are you sure you want to change the base?
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.
스터디 하느라 고생하셨습니다.
피드백 확인하고, 말한거 고민해보시면 좋을 것 같아요~!
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.
main 메소드가 포함된 클래스가 패키지 내부에 포함되도 괜찮은지 생각해보면 좋을 것 같아요
import camp.nextstep.edu.missionutils.Randoms; | ||
import java.util.*; | ||
|
||
public class RacingCarGame { |
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.
도메인 역할과 컨트롤러 역할을 동시에하고 있는 것 같습니다.
컨트롤러는 어떤 역할인지 고민하시고 분리해보면 좋을 것 같아요
} | ||
|
||
public void startRace(OutputView outputView) { | ||
outputView.printMessage("실행 결과"); |
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.
컨트롤러 내 이와 같이 출력 메시지를 직접 작성해주면 어떤점이 좋지 않을지 고민해보면 좋을 것 같아요
endWinners(outputView); | ||
} | ||
|
||
public void raceOnce() { |
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.
public 으로 선언하신 이유가 있나요?
|
||
public void raceOnce() { | ||
for (Car car : cars) { | ||
if (Randoms.pickNumberInRange(0, 9) >= 4) { //0~9사이의 랜덤 숫자를 뽑아 4이상이면 자동차 이동시킨다 |
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.
0, 9, 4는 어떤 의미를 가지는 지 상수로 선언해도 좋을 것 같아요
import java.util.*; | ||
|
||
public class InputView { | ||
private static final int MAX_NAME_LENGTH = 5; |
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.
이 상수가 비즈니스 로직에 포함되는지?
비즈니스 로직에 포함된다면 view에 있어도 괜찮을지? 고민해보면 좋을 것 같아요
} catch (NumberFormatException e) { | ||
throw new IllegalArgumentException("[ERROR] 숫자를 입력해야 합니다."); | ||
} | ||
return tries; |
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.
try{} 내부에서 선언해도 괜찮을 것 같아요
No description provided.