Open
Conversation
PandaHun
requested changes
Apr 5, 2021
Member
PandaHun
left a comment
There was a problem hiding this comment.
.idea 경로는 gitignore에 추가해주세요.
또한 몇몇 요구사항이 만족하지 않아서
피드백 드립니다
| } | ||
|
|
||
|
|
||
| } No newline at end of file |
Member
There was a problem hiding this comment.
다른 클래스 파일에서는 괜찮은데 마지막 줄이 생략됐습니다.
마지막 줄도 컨벤션 중에 한 종류입니다
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; |
Member
There was a problem hiding this comment.
3개의 상수 추출 좋습니다 👍
하지만 조금 더 잘 만들어진 네이밍이 있을 것 같습니다
|
|
||
| import utils.RandomUtils; | ||
|
|
||
| public class Car { |
Member
There was a problem hiding this comment.
상태 값을 전부 포장해 캡슐화를 한 것 처럼 보이지만
결국 게터를 통해 내부 상태가 다른 객체에게 다 노출되고 있습니다.
게터를 사용하지 않고 코드를 작성해보는 습관을 들이는 것이 좋을 것 같습니다
| } | ||
|
|
||
| public Winner winner() { | ||
| return new Winner(cars ,cars.stream() |
Member
There was a problem hiding this comment.
해당 내용이 과연 우승자일까요?
우승자가 직접 우승자를 찾는 걸까요?
| public List<String> getWinnersName() { | ||
| List<String> winnerNames = new ArrayList<>(); | ||
| for (int i = 0; i < cars.size(); i++) { | ||
| if(cars.get(i).getPosition() == maxPosition){ |
| import java.util.List; | ||
| import java.util.Scanner; | ||
|
|
||
| public class InputView { |
Member
There was a problem hiding this comment.
정적메서드 만을 제공하는 정적 클래스 입니다
생성자를 막아줘서 사용의 혼동을 막아주면 좋겠습니다.
java/view/InputView.java
Outdated
| import java.util.Scanner; | ||
|
|
||
| public class InputView { | ||
| private static final Scanner scanner = new Scanner(System.in); |
Member
There was a problem hiding this comment.
Suggested change
| 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(",")); |
|
|
||
| import java.util.List; | ||
|
|
||
| public class ResultView { |
| public static void printWinners(Winner winner) { | ||
| System.out.println("최종 우승자: " + winner.getWinnersName()); | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
모두 해당 객체의 내부 구조를 잘 알고 있어야 가능 할 것 같네요
몰라도 가능하도록 구현을 개선해야 할 것 같습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.