-
Notifications
You must be signed in to change notification settings - Fork 1.1k
step 4 로또 (수동) #4245
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: kay019
Are you sure you want to change the base?
step 4 로또 (수동) #4245
Conversation
javajigi
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.
4단계 미션 진행 👍
4단계에서 인터페이스 활용에 대해 경험해 보면 좋을 것 같아 피드백 남겼어요.
추가로 lotto 패키지에 도메인 객체 수가 늘어나고 있는데요.
패키지 분리도 도전해 보면 어떨까요?
| import java.util.List; | ||
| import java.util.stream.IntStream; | ||
|
|
||
| public class ShuffleNumberGenerator implements LottoNumberGenerator{ |
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 class ShuffleNumberGenerator implements LottoNumberGenerator{ | |
| public class ShuffleNumberGenerator implements LottoNumberGenerator { |
| List<Lotto> manualLottos = readManualLottos(manualCount); | ||
|
|
||
| Lottos issued = issueAll(money, manualCount, manualLottos); |
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단계에서 4단계로 요구사항이 변경될 때 로또를 생성하는 부분의 요구사항만 변경됐다.
로또를 생성하는 부분을 다음과 같은 구조의 인터페이스로 분리해 보는 연습을 해보면 어떨까?
이와 같이 인터페이스로 구현했을 때의 잇점에 대해 고민해 보는 시간을 가져본다.
Lottos는 사용자가 구매한 n장의 로또를 추상화한 객체임
public interface LottosGenerator {
Lottos generate();
}
No description provided.