Skip to content
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

[로또 미션] 박성빈 미션 제출합니다. #48

Open
wants to merge 6 commits into
base: imtotem
Choose a base branch
from

Conversation

ImTotem
Copy link

@ImTotem ImTotem commented Jul 9, 2024

으악 머리아파요...
첫 단추가 매우매우 중요하단걸 깨달았습니다...
3단게부터 급하게 짜느라 요구사항을 하나도 못지킨거 같아요
연산자 오버로딩이 안되는게 너무 불편했어요

리뷰 잘 부탁드립니다

Copy link

@Choi-JJunho Choi-JJunho left a comment

Choose a reason for hiding this comment

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

고생하셨습니다~ 코멘트 확인 부탁드릴게요!

Comment on lines +31 to +35
private static void validateDivideZero(final int money) {
if (money % LOTTO_COST != 0) {
throw new IllegalArgumentException("돈은 " + LOTTO_COST + "의 배수여야 함");
}
}

Choose a reason for hiding this comment

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

예외처리 꼼꼼하네요 👍

public class Lotto {
private final Set<LottoNumber> numbers;

public Lotto(final Set<LottoNumber> numbers) {

Choose a reason for hiding this comment

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

파라미터에 final이 있는게 있고 없는게 있는데 본인만의 기준이 있는건가요?

Copy link
Author

Choose a reason for hiding this comment

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

열심히 생각하면서 쓰다가 힘들어서 포기했습니다 ㅎㅋㅋㅎㅋ

Comment on lines 3 to 4
import static lotto.global.Constants.MAX_NUMBER;
import static lotto.global.Constants.MIN_NUMBER;

Choose a reason for hiding this comment

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

해당 값을 전역적인 변수로 두면 어떤 최소/최대_숫자 인지 헷갈리지 않을까 고민이 되네요
제 개인적으로는 LottoNumber의 속성값인 듯 하여 LottoNumber 클래스 내부에 해당 상수를 정의하지 않을까 싶은데 어떻게 생각하세요?

Copy link
Author

Choose a reason for hiding this comment

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

LottoNumber 클래스의 내부에 두는게 더 나을 것 같네용

Comment on lines 10 to 11
private List<Lotto> lottos;
private List<Lotto> customLottos;

Choose a reason for hiding this comment

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

일반 로또와 custom 로또와 구분되는 이유가 있나요?

Copy link
Author

Choose a reason for hiding this comment

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

customLottos의 size를 이용하여 수동으로 몇장 구매했는지 출력하기위해 구분했습니다.
지금 생각해보면 구분할 필요가 없는거 같아요

package lotto.model;

public class Money {
private final int money;

Choose a reason for hiding this comment

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

꼼꼼한 원시값 포장 👍

import java.util.stream.Collectors;
import java.util.stream.IntStream;

public class NumberGenerator implements Generator {

Choose a reason for hiding this comment

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

차라리 LottoNuberGenerator로 구체화를 시켜버리는건 어떤가요?
start, end, size를 파라미터로 받아서 Set을 만들어주는 객체는 역할이 다소 모호해보인다는 개인적인 의견입니다 :)

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