Open
Conversation
ksy90101
requested changes
Apr 8, 2025
ksy90101
left a comment
There was a problem hiding this comment.
고생하셨습니다~ 간단한 피드백을 남겼으니 확인한번 부탁드리겠습니다!
Comment on lines
+16
to
+20
| private void validate(final TicketCount totalTicketCount, final TicketCount manualTicketCount) { | ||
| if (totalTicketCount.getCount() < manualTicketCount.getCount()) { | ||
| throw new IllegalArgumentException("수동으로 구매하려는 로또 수가 총 구매 가능한 로또 수를 초과합니다."); | ||
| } | ||
| } |
There was a problem hiding this comment.
이 validate의 의미가 조금 이상하네요.
로직이 틀렸다기 보단, 실제 "autoTicketCount"에 대해서도 필요하지 않을까 생각이 듭니다.
Comment on lines
+25
to
+28
|
|
||
| for (int i = 0; i < manualTicketCount.getCount(); i++) { | ||
| tickets.add(new LottoTicket(inputLottoNumbers())); | ||
| } |
Comment on lines
+17
to
+22
| public TicketCount inputManualTicketCount() { | ||
| System.out.println("수동으로 구매할 로또 수를 입력해 주세요."); | ||
| return new TicketCount(Integer.parseInt(scanner.nextLine())); | ||
| } | ||
|
|
||
| public List<LottoTicket> inputManualTicketNumbers(final TicketCount manualTicketCount) { |
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.
로또: 4단계 - 로또(수동)