Skip to content

Conversation

@kay019
Copy link

@kay019 kay019 commented Jan 4, 2026

No description provided.

Copy link
Contributor

@javajigi javajigi left a 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{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public class ShuffleNumberGenerator implements LottoNumberGenerator{
public class ShuffleNumberGenerator implements LottoNumberGenerator {

Comment on lines 20 to 22
List<Lotto> manualLottos = readManualLottos(manualCount);

Lottos issued = issueAll(money, manualCount, manualLottos);
Copy link
Contributor

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();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants