-
Notifications
You must be signed in to change notification settings - Fork 7
[8주차] nyj #54
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
base: nyj
Are you sure you want to change the base?
[8주차] nyj #54
Conversation
PandaHun
left a comment
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.
.idea 경로는 gitignore에 추가해주세요.
또한 몇몇 요구사항이 만족하지 않아서
피드백 드립니다
| } | ||
|
|
||
|
|
||
| } No newline at end of file |
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.
다른 클래스 파일에서는 괜찮은데 마지막 줄이 생략됐습니다.
마지막 줄도 컨벤션 중에 한 종류입니다
java/racingcar/Car.java
Outdated
| public class Car { | ||
| private static final int FIRST_DIGIT = 0; | ||
| private static final int LAST_DIGIT = 9; | ||
| private static final int MOVING_NUMBER = 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.
3개의 상수 추출 좋습니다 👍
하지만 조금 더 잘 만들어진 네이밍이 있을 것 같습니다
|
|
||
| import utils.RandomUtils; | ||
|
|
||
| public class Car { |
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 Winner winner() { | ||
| return new Winner(cars ,cars.stream() |
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 List<String> getWinnersName() { | ||
| List<String> winnerNames = new ArrayList<>(); | ||
| for (int i = 0; i < cars.size(); i++) { | ||
| if(cars.get(i).getPosition() == maxPosition){ |
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.
인덴트는 최대 1입니다
| import java.util.List; | ||
| import java.util.Scanner; | ||
|
|
||
| public class InputView { |
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.
정적메서드 만을 제공하는 정적 클래스 입니다
생성자를 막아줘서 사용의 혼동을 막아주면 좋겠습니다.
java/view/InputView.java
Outdated
| import java.util.Scanner; | ||
|
|
||
| public class InputView { | ||
| private static final Scanner scanner = new Scanner(System.in); |
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.
| private static final Scanner scanner = new Scanner(System.in); | |
| private static final Scanner SCANNER= new Scanner(System.in); |
java/view/InputView.java
Outdated
|
|
||
| public static List<String> inputCarName(){ | ||
| System.out.println("경주할 자동차 이름을 입력하세요.(이름은 쉼표(,) 기준으로 구분)"); | ||
| List<String> carName = Arrays.asList(scanner.nextLine().split(",")); |
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.
불필요한 inline 변수 같습니다
|
|
||
| import java.util.List; | ||
|
|
||
| public class ResultView { |
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.
InputView와 마찬가지
| public static void printWinners(Winner winner) { | ||
| System.out.println("최종 우승자: " + winner.getWinnersName()); | ||
| } | ||
| } |
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.