[로또] 김하빈 미션 제출합니다#5
Open
KIM-GOING wants to merge 5 commits intoJava-JavaScript-Language-Stuty:mainfrom
Open
Conversation
daeGULLL
added a commit
to 2025JavaGroupStudy/java-lotto-7
that referenced
this pull request
Feb 27, 2025
daeGULLL
reviewed
Feb 27, 2025
daeGULLL
left a comment
There was a problem hiding this comment.
오류 빨리 해결되셨으면 좋겠습니다...그놈의 빨간색 볼때마다 짜증나죠.. 그것 외로는 굉장히 깔끔한 코드였던 것 같아요! MVC패턴이 잘 이해안가시면 제가 디스코드 java 스터디정리에 올려둔 MVC패턴 정리글 읽으시면 도움될 것 같습니다! 마지막 주차 힘내봐요..ㅠㅠ
|
|
||
| // 로또 구입 개수 연산 | ||
| public int setPurchaseLotto() { | ||
| InputMoney tmpMoney = new InputMoney(); |
There was a problem hiding this comment.
여기서 오류가 나는것 같아요!! 메인 어플리케이션에서 inputMoney를 하나 생성하셨는데 여기서 또 생성하면 입력이 두번 호출되니까용 여기서 new 를 통해 새 instance를 생성하는것보단 함수 파라미터로 기존 생성한 inputMoney를 받아서 사용하시고 inputMoney내부나 다른 코드로 한번 얻은 money값을 저장하는 변수를 두셔야할것 같아용 그 변수값만 불러오는 방식으로 바꾸시면 해결될 것 같아요!
|
|
||
| // 올바른 입력 체크 합수 | ||
| public int checkBonus(String strBonus) { | ||
|
|
There was a problem hiding this comment.
view마다 check~~() 함수를 두는것보다 util 디렉토리 아래에 Validator 파일을 하나 만들어서 전체 코드에서 여러 검증만을 담당하게 코드를 짜도 좋을 것 같아요!
| OutputView output = new OutputView(); | ||
|
|
||
| money.getMoney(); | ||
| output.showLottoCount(); |
There was a problem hiding this comment.
view들만 사용하는것보단 view와 모델 사이의 상호작용을 관리할 controller를 만드시는게 더 좋을것 같습니다~~
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.
미션 미완성😭
문제 상황
현재 mvc 패턴을 적용하며 inputview 전체와 model 일부를 작성하였습니다. 나머지 부분을 작성하기 전 확인을 위해 outputview를 작성하고 테스트를 진행하며 중복 호출이 되는 문제를 발견하였습니다.
현재 제 예상으로는 생성자가 두번 호출되고 있는 문제라고 생각되고, 이를 고치기 위해 모든 클래스에 기본 생성자를 설정해줄 계획입니다.
현재까지 구현 상황
1. 입력부
2. 연산부
3. 출력부
4. 예외부
로또 구입 금액의 오류
당첨 번호의 오류
보너스 번호의 오류
중요하게 고려한 부분
MVC 패턴을 이번주차에 처음 적용해보면서 최대한 나눠보려고 노력하였습니다. 다만,, 아직 MVC 패턴에 대한 정확한 이해가 안되어 부족한 점이 많습니다.
피드백을 요하는 부분
1. controller의 역할
미션을 구현하며 controller의 역할이 없어졌습니다. 현재까지 작성된 부분에서 controller로 옮기면 좋을 법한 부분이 어딘지 알고 싶습니다.
2. 현재 문제상황의 원인
말 그대로 제가 예상한 생성자 문제가 맞는지 피드백 주시면 감사하겠습니다!