Conversation
genius00hwan
left a comment
There was a problem hiding this comment.
전반적으로 MVC 패턴을 적용하려는 노력이 보였습니다. 나중에는 패키징도 같이 신경써주면 좋겠습니다.
| @@ -0,0 +1,24 @@ | |||
| package lotto; | |||
|
|
|||
| public enum LOTTOERROR { | |||
There was a problem hiding this comment.
enum 클래스는 enum 클래스 자체보다는 객체들을 대문자로만 표현합니다.
enum LottoError {
STRING_ERROR
...
}이런식으로요
| boolean bonusFlag = false; | ||
| for(int userNum : userNumbers){ | ||
| for(int num : numbers){ | ||
| if(num == userNum) cnt++; |
There was a problem hiding this comment.
전에도 말했지만 indent 3이상은 지양해주세요
There was a problem hiding this comment.
contains 라는 함수를 이용할수 있을것 같아요
| @@ -0,0 +1,18 @@ | |||
| package lotto; | |||
|
|
|||
| public enum VALUESETTING { | |||
There was a problem hiding this comment.
LOTTOERROR 와 같은 피드백을 드립니다.
| throw new IllegalArgumentException(); | ||
| } | ||
| } | ||
| public List<Integer> getNumbers(){ |
There was a problem hiding this comment.
굳이 이 번호 전체를 getter로 가져와야만 할까요?
get(index) 와 같은 함수를 구현해도 괜찮지 않을까요?
| @@ -0,0 +1,57 @@ | |||
| package lotto; | |||
|
|
|||
| public class LottoGameController { | |||
There was a problem hiding this comment.
run을 제외한 함수들은 private으로 구현할 수 있겠네요.
| private int amount; | ||
| private Lotto[] lottos; | ||
| public LottoSeller(){} | ||
| public LottoSeller(String priceInput){ |
There was a problem hiding this comment.
생성자에서 로직이 실행되네요 적합하지 않다고 생각합니다.
| sellLottos(); | ||
| } | ||
| public void validate(String priceInput){ | ||
| ErrorChecker checker = new ErrorChecker(); |
There was a problem hiding this comment.
LottoSeller는 ErrorChecker에게 의존성이 있네요.
의존성주입 혹은 의존성 검색을 통해 의존성을 부여해보세요
| winningNumbers = changeNumbersType(winningNumbersInput); | ||
| } | ||
| public void validate(String[] winningNumbersInput){ | ||
| ErrorChecker checker = new ErrorChecker(); |
There was a problem hiding this comment.
의존성관련 같은 질문피드백을 드립니다. 무분별한 생성은 지양합시다.
| System.out.println("당첨 번호를 입력해주세요."); | ||
| } | ||
| public void printBonusNumberInputMessage(){ | ||
| System.out.println("보너스 번호를 입력해주세요."); |
There was a problem hiding this comment.
출력값이 변동되면 어떡하죠? 출력값도 ENUM으로 상수로 관리하는게 좋다고 생각합니다.
upload2 확인해주시면 될 것 같습니다!