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

[Step4] 4단계 - 로또(수동) PR 요청드립니다. #552

Open
wants to merge 21 commits into
base: dajeong
Choose a base branch
from

Conversation

dajeong
Copy link

@dajeong dajeong commented Dec 12, 2022

남재님 안녕하세요! 😃
4단계 리뷰 요청이 늦었습니다흑ㅠ
3단계 리뷰에서 주신 코멘트에 대한 내용 반영했습니다.
이번에도 잘 부탁 드리겠습니닷~! 🙇

Copy link

@namjackson namjackson left a comment

Choose a reason for hiding this comment

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

4단계 미션 고생하셨습니다!
리뷰가 살짝 늦었네요 ㅠㅠ!
이전 미션에서 잘작성해주셔서, 크게 피드백은 없으나,
로또미션 마지막단계이니, 몇가지 참고하실만한 코멘트들 남겼으니, 확인해주세요 😄
변경사항 적용 후, 리뷰요청해주세요!

src/main/kotlin/lotto/common/DoubleNumber.kt Outdated Show resolved Hide resolved
src/main/kotlin/lotto/domain/LottoNumber.kt Show resolved Hide resolved
src/main/kotlin/lotto/domain/LottoRank.kt Outdated Show resolved Hide resolved
src/main/kotlin/lotto/domain/Payment.kt Outdated Show resolved Hide resolved
src/main/kotlin/lotto/domain/Payment.kt Outdated Show resolved Hide resolved
src/main/kotlin/lotto/domain/LottoShop.kt Outdated Show resolved Hide resolved
dajeong added 3 commits December 27, 2022 11:38
모든 원시값 포장을 잘못이해하여 생서한 클래스들 제거
+ 수익률 오류 수정
+ Payment 클래스의 프로퍼티명 수정
payment(지불금액)이 로또를 구매할 때 변경돼야하기 때문에 lottoShop에서 payment를 가지는 구조로 변경
@dajeong
Copy link
Author

dajeong commented Dec 27, 2022

남재님 안녕하세요! 😃
피드백 주신 부분 반영했습니다.
원시값 포장에 대해 질문해 주신 부분에 대해 답변도 남겼어요! 요구사항에 대해 잘못 이해하고 코드를 작성했었네요ㅠ

추가 수정된 내용도 있으니 함께 리뷰 부탁드립니다!
감사합니다. 🙏

Copy link

@namjackson namjackson left a comment

Choose a reason for hiding this comment

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

안녕하세요 다정님!
변경사항 적용잘해주셨네요! 몇가지 추가 코멘트 작성하였습니다!
확인해주세요! 로또 마지막 미션이니, 조금 더 힘내세요!! 🏃

import io.kotest.core.spec.style.StringSpec
import io.kotest.matchers.shouldBe

class PaymentTest : StringSpec({

Choose a reason for hiding this comment

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

리팩터링 과정에서 테스트가 꺠졌네요!
테스트 코드도 전체적으로 돌려봐주세요!

Copy link
Author

Choose a reason for hiding this comment

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

헛 감사합니다!

val inputLuckyNumbers = inputView.inputLuckyNumbers()
val inputBonusNumber = inputView.inputBonusNumber()

val lottoResultService = LottoResultService(LuckyNumbers(inputLuckyNumbers, inputBonusNumber))
val lottoResultService = LottoResultService(Lotto(inputLuckyNumbers.integerNumberList.map { LottoNumber(it) }), LottoNumber(inputBonusNumber))

Choose a reason for hiding this comment

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

죄송합니다 🙏 이전 미션 코멘트에서
커뮤니케이션 미스가 있었던거 같아요 ㅠㅠ!

luckyNumbers는 lotto 클래스와 동일한 구조인거 같아요!
당첨번호의 luckyNumbers는 lotto 번호라고 보아도 되지않을가요?

LuckyNumbers 클래스가 아닌, LuckyNumbers객체의 List인 luckyNumbers 컬렉션을 의미하는 코멘트였습니다 ㅠㅠ

이전처럼 class LuckyNumbers( private val lotto: List<Lotto>, private val bonusNumber: Int)가 rank를 생성에 대한 책임은 이곳에 있어야하는게 맞는거같네요 ㅠ,ㅠ

Copy link
Author

Choose a reason for hiding this comment

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

아하 넵 ㅠㅠ 이해했습니다

@@ -1,12 +1,26 @@
package lotto.domain

class LottoResultService(
private val luckyNumbers: LuckyNumbers,
private val luckyLotto: Lotto,
private val bonusNumber: LottoNumber

Choose a reason for hiding this comment

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

LottoResultService 라는 이름에 맞게
luckyLotto, luckyNumbers가 아닌
List<LottoRank>가 생성자에 있어야하지 않을까요?

import lotto.util.RandomNumberGenerator
import lotto.view.InputView
import lotto.view.ResultView

class Application {
private val inputView = InputView()
private val resultView = ResultView()
private val lottoShop = LottoShop(LottoGenerator(RandomNumberGenerator()))
private val lottoGenerator = LottoGenerator(RandomNumberGenerator())

fun run() {

Choose a reason for hiding this comment

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

run함수가 비대해진거 같아요!
로또 구매, 로또확인, 결과출력 과 같이 함수로 분리해보면 어떨까요?

package lotto.common

class IntegerNumberList(
val integerNumberList: List<Int>

Choose a reason for hiding this comment

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

수동 로또 구매를 위한 컬렉션이라면,
차라리 LottoTicket과 같은 네이밍은 어떨까요?

  • Ticket에도 숫자가 6개 인지도 필요하긴한거같아요

@@ -5,11 +5,10 @@ import lotto.util.NumberUtil
class LottoStatistics(

Choose a reason for hiding this comment

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

LottoStatistics 클래스는 List의 일급컬렉션이라과 봐도될거같아요!
개인적으로 LottoRanks 같은 이름이 좀더 가독성에 좋을거같단 생각이 들어요!

Comment on lines +24 to +26
val manualLottoList = lottoShop.buyManualLotto(manualNumberList)
val autoLottoList = lottoShop.buyAutoLotto()
resultView.printLottoList(manualLottoList, autoLottoList)

Choose a reason for hiding this comment

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

개인적으로 수동 로또를 구매하고, 자동로또를 구매하는 로직은
구매에 대한 책임이 있는 LottoShop가 수행하여도 좋을거같아요!

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.

None yet

2 participants