-
Notifications
You must be signed in to change notification settings - Fork 5
[로또] 레몽(이규명) 미션 제출합니다. #2
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: lgm1007
Are you sure you want to change the base?
Changes from all commits
cc2f768
1177834
27be596
aa533b6
64baade
0b778be
ef5951f
3183b40
2deb60b
6d71e62
1d4105d
7afd95c
81b2527
e029076
68ebdcc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| # 기능 요구사항 | ||
| ### 로또 구매 | ||
| * 구입 금액을 입력하면 구입 금액에 해당하는 만큼 로또를 발급한다. | ||
| * 로또 1장의 가격은 1000원이다. | ||
|
|
||
| ### 지난 주 당첨 번호 비교 | ||
| * 지난 주 당첨 번호와 보너스 볼 번호를 입력받는다. | ||
| * 발급된 로또와 비교하여 당첨 통계를 생성한다. | ||
| * 3개 일치 (5000원) | ||
| * 4개 일치 (50000원) | ||
| * 5개 일치 (1500000원) | ||
| * 5개 일치, 보너스 볼 일치(30000000원) | ||
| * 6개 일치 (2000000000원) | ||
| * 총 수익률을 계산해서 출력해준다. | ||
| * 수익률은 구매한 금액 / 총 당첨 금액 계산값을 소수점 두 자리 수까지 나타낸 수이다. | ||
|
|
||
| ### 수동 로또 구매 | ||
| * 로또 구입 금액 입력 후 수동 구매 수량을 입력받는다. | ||
| * 수동 구매 수량을 입력받은 후 수동으로 구매할 로또 번호를 구매 수량만큼 입력받는다. | ||
| * 자동 구매권 수량은 총 구매한 개수 - 수동 구매 수량이다. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| import controller.AmountRequest; | ||
| import controller.BonusNumberRequest; | ||
| import controller.ManualNumberRequest; | ||
| import controller.WinningNumberRequest; | ||
| import domain.PhraseLottoExecutor; | ||
| import domain.RateCalculateExecutor; | ||
| import domain.WinningConfirmExecutor; | ||
| import view.InputView; | ||
| import vo.LottoNumberCollectionList; | ||
| import vo.WinningTypeCollection; | ||
|
|
||
| public class Application { | ||
|
|
||
| public static void main(String[] args) { | ||
| final AmountRequest amountRequest = InputView.inputAmount(); | ||
| final ManualNumberRequest manualNumberRequest = InputView.inputManual(amountRequest.getLottoAmount()); | ||
| final WinningTypeCollection winningTypeCollection = retrieveWinning( | ||
| receivePhraseLotto(amountRequest, manualNumberRequest) | ||
| ); | ||
| final RateCalculateExecutor rateCalculateExecutor = new RateCalculateExecutor(amountRequest, winningTypeCollection); | ||
| rateCalculateExecutor.calculateRate(); | ||
| } | ||
|
|
||
| private static LottoNumberCollectionList receivePhraseLotto(final AmountRequest amountRequest, final ManualNumberRequest manualNumberRequest) { | ||
| PhraseLottoExecutor phraseLottoExecutor = new PhraseLottoExecutor(amountRequest, manualNumberRequest); | ||
| phraseLottoExecutor.phraseLotto(); | ||
| return phraseLottoExecutor.pickLottoNumber(); | ||
| } | ||
|
|
||
| private static WinningTypeCollection retrieveWinning(final LottoNumberCollectionList lottoNumberCollectionList) { | ||
| WinningNumberRequest winningNumberRequest = InputView.inputWinningNumber(); | ||
| BonusNumberRequest bonusNumberRequest = InputView.inputBonusNumber(); | ||
| WinningConfirmExecutor winningConfirmExecutor = new WinningConfirmExecutor(lottoNumberCollectionList, winningNumberRequest, bonusNumberRequest); | ||
| return winningConfirmExecutor.confirmWinningType(); | ||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| package controller; | ||
|
|
||
| import validator.AmountValidator; | ||
|
|
||
| public class AmountRequest { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Amount는 단어 의미 그대로 로또의 수량에 대한 의미로 사용했고, 로또의 수량은 구매 금액 / 로또 금액으로 구해지다보니 로또의 금액을 해당
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
로또의 수량에 대한 의미로 사용하려면, LottoCount 등으로 네이밍을 더 명확하게 좁혀야 혼란이 줄어들 것 같아요. |
||
| private final int lottoAmount; | ||
|
|
||
| private static final int LOTTO_PRICE = 1000; | ||
|
|
||
| private AmountRequest(final int lottoAmount) { | ||
| this.lottoAmount = lottoAmount; | ||
| } | ||
|
|
||
| public static AmountRequest from(final String lottoAmountInput) { | ||
| final int lottoAmount = Integer.parseInt(lottoAmountInput); | ||
lgm1007 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| AmountValidator.validateAmountNegative(lottoAmount); | ||
| return new AmountRequest(lottoAmount); | ||
| } | ||
lgm1007 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| public int getLottoAmount() { | ||
| return this.lottoAmount; | ||
| } | ||
|
|
||
| public int fetchPhraseLottoCount() { | ||
| return (int) this.lottoAmount / LOTTO_PRICE; | ||
| } | ||
|
Comment on lines
+24
to
+26
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 금액별로 로또를 몇 장 구매할 수 있는지 계산해야하는 책임을 Request 객체가 가지는 것은 조금 어색하다고 느꼈어요. XXXRequest 라서 단순 DTO 같은데 꽤 중요한 로직이 여기 있어도 될까라는 생각이 들었습니다 ㅎㅎ
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아하 그렇게 받아드릴 수도 있을 것 같아요! 저는 |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package controller; | ||
|
|
||
| public class BonusNumberRequest { | ||
| private final int bonusNumber; | ||
|
|
||
| private BonusNumberRequest(final int bonusNumber) { | ||
| this.bonusNumber = bonusNumber; | ||
| } | ||
|
|
||
| public static BonusNumberRequest from(final String bonusNumberInput) { | ||
| return new BonusNumberRequest(generateBonusNumber(bonusNumberInput)); | ||
| } | ||
|
|
||
| private static int generateBonusNumber(final String bonusNumberInput) { | ||
| return Integer.parseInt(bonusNumberInput); | ||
| } | ||
|
Comment on lines
+14
to
+16
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 보너스 볼에 대한 요구사항은 보너스 볼을 실제로는 단순히 정수 타입으로 바꿔주는 기능밖에 없는데, 이런 메서드가 필요한지는 조금 의문입니다 :)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 맞아요 이는 메서드 네이밍 선정의 오류였던 것 같아요~ 실제로는 입력에 그치는 게 맞습니다! |
||
|
|
||
| public int getBonusNumber() { | ||
| return this.bonusNumber; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| package controller; | ||
|
|
||
| import vo.LottoNumberCollection; | ||
| import vo.LottoNumberCollectionList; | ||
|
|
||
| import java.util.Arrays; | ||
| import java.util.List; | ||
| import java.util.stream.Collectors; | ||
|
|
||
| public class ManualNumberRequest { | ||
| private final int manualCount; | ||
| private final LottoNumberCollectionList lottoNumberCollectionList; | ||
|
|
||
| private static final String LOTTO_NUMBER_SPLIT_REGEX = ","; | ||
|
Comment on lines
+11
to
+14
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 일반적으로 static 필드는 인스턴스 필드보다 위에 위치시켜요 ㅎㅎ
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 그렇군요 뭔가 인스턴스 변수 아래에 상수를 작성하는 이상한 버릇이 언젠가부터 생긴 거 같은데 관례를 따르도록 교정해봐야겠어요! |
||
|
|
||
| private ManualNumberRequest(final int manualCount, final LottoNumberCollectionList lottoNumberCollectionList) { | ||
| this.manualCount = manualCount; | ||
| this.lottoNumberCollectionList = lottoNumberCollectionList; | ||
| } | ||
|
|
||
| public static ManualNumberRequest of(final int manualCount, final List<String> manualNumberInputs) { | ||
| final List<LottoNumberCollection> lottoNumberCollectionList = manualNumberInputs.stream() | ||
| .map(manualInput -> { | ||
| String[] splitInput = manualInput.replaceAll(" ", "").split(LOTTO_NUMBER_SPLIT_REGEX); | ||
| return LottoNumberCollection.from(Arrays.stream(splitInput) | ||
| .map(Integer::parseInt) | ||
| .collect(Collectors.toList())); | ||
| }) | ||
| .collect(Collectors.toList()); | ||
|
|
||
| return new ManualNumberRequest(manualCount, LottoNumberCollectionList.from(lottoNumberCollectionList)); | ||
| } | ||
|
|
||
| public int getManualCount() { | ||
| return manualCount; | ||
| } | ||
|
|
||
| public LottoNumberCollectionList getLottoNumberCollectionList() { | ||
| return lottoNumberCollectionList; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| package controller; | ||
|
|
||
| import java.util.Arrays; | ||
| import java.util.List; | ||
| import java.util.stream.Collectors; | ||
|
|
||
| public class WinningNumberRequest { | ||
| private final List<Integer> winningNumbers; | ||
|
|
||
| private static final String WINNING_NUMBER_SPLIT_REGEX = ","; | ||
|
|
||
| private WinningNumberRequest(final List<Integer> winningNumbers) { | ||
| this.winningNumbers = winningNumbers; | ||
| } | ||
|
|
||
| public static WinningNumberRequest from(final String winningNumberInput) { | ||
| return new WinningNumberRequest(generateWinningNumber(winningNumberInput)); | ||
| } | ||
|
|
||
| private static List<Integer> generateWinningNumber(final String winningNumberInput) { | ||
| String[] splitInput = winningNumberInput | ||
| .replaceAll(" ", "") | ||
| .split(WINNING_NUMBER_SPLIT_REGEX); | ||
| return Arrays.stream(splitInput) | ||
| .map(Integer::parseInt) | ||
| .collect(Collectors.toList()); | ||
| } | ||
|
|
||
| public List<Integer> getWinningNumbers() { | ||
| return List.copyOf(this.winningNumbers); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| package domain; | ||
|
|
||
| import controller.AmountRequest; | ||
| import controller.ManualNumberRequest; | ||
| import view.OutputView; | ||
|
Comment on lines
+1
to
+5
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 도메인이 뷰를 알고 있군요! 이럴 경우 어떤 문제가 발생할 수 있을지 고민해보셔도 좋을 것 같아요 :) |
||
| import vo.LottoNumberCollection; | ||
| import vo.LottoNumberCollectionList; | ||
|
|
||
| import java.util.ArrayList; | ||
| import java.util.Collections; | ||
| import java.util.List; | ||
| import java.util.stream.IntStream; | ||
|
|
||
| public class PhraseLottoExecutor { | ||
| private final AmountRequest amountRequest; | ||
| private final ManualNumberRequest manualNumberRequest; | ||
|
Comment on lines
+14
to
+16
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| private static final List<Integer> LOTTO_NUMBERS = new ArrayList<>(); | ||
| private final static int LOTTO_NUMBER_COUNT = 6; | ||
|
|
||
| static { | ||
| for (int i = 1; i <= 45; i++) { | ||
| LOTTO_NUMBERS.add(i); | ||
| } | ||
| } | ||
|
|
||
| public PhraseLottoExecutor(final AmountRequest amountRequest, final ManualNumberRequest manualNumberRequest) { | ||
| this.amountRequest = amountRequest; | ||
| this.manualNumberRequest = manualNumberRequest; | ||
| } | ||
|
|
||
| public void phraseLotto() { | ||
| OutputView.outputPhraseLotto(this.manualNumberRequest.getManualCount(), calculateRandomPickCount()); | ||
| } | ||
|
|
||
| public LottoNumberCollectionList pickLottoNumber() { | ||
| List<LottoNumberCollection> lottoNumberCollectionRequest = fetchRandomLottoNumberCollectionList(); | ||
|
|
||
| LottoNumberCollectionList lottoNumberCollectionList = this.manualNumberRequest.getLottoNumberCollectionList(); | ||
| lottoNumberCollectionList.addAllLottoNumberCollection(LottoNumberCollectionList.from(lottoNumberCollectionRequest)); | ||
| OutputView.outputPickedLottoNumber(lottoNumberCollectionList); | ||
| return lottoNumberCollectionList; | ||
| } | ||
|
Comment on lines
+32
to
+43
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이 객체는 최소 두 가지 역할을 맡고 있네요.
역할이 많아진다는 것은 곧 클래스의 설계가 잘못되었음을 나타내는 지표라고 볼 수 있을 것 같습니다 :) |
||
|
|
||
| private List<LottoNumberCollection> fetchRandomLottoNumberCollectionList() { | ||
| List<LottoNumberCollection> lottoNumberCollectionRequest = new ArrayList<>(); | ||
|
|
||
| for (int i = 0; i < calculateRandomPickCount(); i++) { | ||
| List<Integer> pickLottoNumbers = new ArrayList<>(); | ||
| Collections.shuffle(LOTTO_NUMBERS); | ||
| IntStream.range(0, LOTTO_NUMBER_COUNT).forEach(index -> { | ||
| pickLottoNumbers.add(LOTTO_NUMBERS.get(index)); | ||
| }); | ||
|
|
||
| lottoNumberCollectionRequest.add(LottoNumberCollection.from(pickLottoNumbers)); | ||
| } | ||
| return lottoNumberCollectionRequest; | ||
| } | ||
|
|
||
| private int calculateRandomPickCount() { | ||
| return this.amountRequest.fetchPhraseLottoCount() - this.manualNumberRequest.getManualCount(); | ||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package domain; | ||
|
|
||
| import controller.AmountRequest; | ||
| import view.OutputView; | ||
| import vo.WinningTypeCollection; | ||
|
Comment on lines
+1
to
+5
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 여기도 도메인이 컨트롤러와 뷰를 알고 있네요!
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. POJO에서의 MVC란 참으로 어렵군요ㅎㅎ 아직 배울 게 많다는 건 발전할 수 있다는 점으로 받아드리려고자 합니다! |
||
|
|
||
| public class RateCalculateExecutor { | ||
| private final AmountRequest amountRequest; | ||
| private final WinningTypeCollection winningTypeCollection; | ||
|
|
||
| public RateCalculateExecutor(final AmountRequest amountRequest, final WinningTypeCollection winningTypeCollection) { | ||
| this.amountRequest = amountRequest; | ||
| this.winningTypeCollection = winningTypeCollection; | ||
| } | ||
|
|
||
| public void calculateRate() { | ||
| // 수익률은 소수점 둘째 자리까지 출력 | ||
| final double rate = Math.round(winningTypeCollection.calculateTotalWinningPrice() / amountRequest.getLottoAmount()); | ||
| OutputView.outputRateOfReturn(rate); | ||
|
|
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| package domain; | ||
|
|
||
| import controller.BonusNumberRequest; | ||
| import controller.WinningNumberRequest; | ||
| import strategy.WinningPriceStrategy; | ||
| import strategy.WinningPriceStrategyFactory; | ||
| import view.OutputView; | ||
| import vo.LottoNumberCollection; | ||
| import vo.LottoNumberCollectionList; | ||
| import vo.WinningTypeCollection; | ||
| import vo.param.WinningMatchParam; | ||
|
|
||
| import java.util.List; | ||
| import java.util.Optional; | ||
|
|
||
| public class WinningConfirmExecutor { | ||
| private final LottoNumberCollectionList lottoNumberCollectionList; | ||
| private final WinningNumberRequest winningNumberRequest; | ||
| private final BonusNumberRequest bonusNumberRequest; | ||
|
|
||
| public WinningConfirmExecutor(final LottoNumberCollectionList lottoNumberCollectionList, | ||
| final WinningNumberRequest winningNumberRequest, | ||
| final BonusNumberRequest bonusNumberRequest) { | ||
| this.lottoNumberCollectionList = lottoNumberCollectionList; | ||
| this.winningNumberRequest = winningNumberRequest; | ||
| this.bonusNumberRequest = bonusNumberRequest; | ||
| } | ||
|
|
||
| public WinningTypeCollection confirmWinningType() { | ||
| final WinningTypeCollection winningTypeCollection = new WinningTypeCollection(); | ||
| final List<LottoNumberCollection> pickedLottoNumberCollectionList = this.lottoNumberCollectionList.getLottoNumberCollectionList(); | ||
|
|
||
| for (LottoNumberCollection pickedLottoNumberCollection : pickedLottoNumberCollectionList) { | ||
| int winningMatchCount = pickedLottoNumberCollection.countWinningMatch(this.winningNumberRequest.getWinningNumbers()); | ||
| boolean isMatchBonus = pickedLottoNumberCollection.isMatchBonus(this.bonusNumberRequest.getBonusNumber()); | ||
|
|
||
| Optional<WinningPriceStrategy> optionalStrategy = Optional.ofNullable( | ||
| WinningPriceStrategyFactory.getInstance().create(WinningMatchParam.from(winningMatchCount, isMatchBonus)) | ||
| ); | ||
| optionalStrategy.ifPresent(winningPriceStrategy -> winningTypeCollection.addWinningType(winningPriceStrategy.fetchWinningType())); | ||
|
Comment on lines
+37
to
+40
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 명시적인 null 체크 이후 로직을 전개하면 Optional 객체를 안 만들어도 될 것 같은데, Optional을 언제 어떻게 사용하면 좋을 지 같이 고민해보시죠~!
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 네 좋은 자료 공유 감사합니다 😊 여기서 Optional을 사용한 이유는 로또 당첨이 안 된 경우에 대한 경우에는 |
||
| } | ||
|
|
||
| OutputView.outputLottoWinningPrice(winningTypeCollection); | ||
| return winningTypeCollection; | ||
| } | ||
|
|
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package strategy; | ||
|
|
||
| import vo.enums.WinningType; | ||
|
|
||
| public class FiveBonusMatchWinningStrategy implements WinningPriceStrategy { | ||
| @Override | ||
| public WinningType fetchWinningType() { | ||
| return WinningType.FIVE_BONUS_MATCH; | ||
| } | ||
|
Comment on lines
+5
to
+9
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 무엇을 얻기 위해 전략 패턴을 사용하셨는지 궁금해요 :) 전략 패턴을 사용해서 다형성이 구현되어있는데,
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 만들었을 당시에는 당첨 조건이나 각 당첨 등수에 대한 분기에 해당하는 로직을 전략으로 만들어서 구현해보자~ 라는 생각으로 만들었긴 했습니다. |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package strategy; | ||
|
|
||
| import vo.enums.WinningType; | ||
|
|
||
| public class FiveMatchWinningStrategy implements WinningPriceStrategy { | ||
| @Override | ||
| public WinningType fetchWinningType() { | ||
| return WinningType.FIVE_MATCH; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package strategy; | ||
|
|
||
| import vo.enums.WinningType; | ||
|
|
||
| public class FourMatchWinningStrategy implements WinningPriceStrategy { | ||
| @Override | ||
| public WinningType fetchWinningType() { | ||
| return WinningType.FOUR_MATCH; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package strategy; | ||
|
|
||
| import vo.enums.WinningType; | ||
|
|
||
| public class SixMatchWinningStrategy implements WinningPriceStrategy { | ||
| @Override | ||
| public WinningType fetchWinningType() { | ||
| return WinningType.SIX_MATCH; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| package strategy; | ||
|
|
||
| import vo.enums.WinningType; | ||
|
|
||
| public class ThreeMatchWinningStrategy implements WinningPriceStrategy { | ||
| @Override | ||
| public WinningType fetchWinningType() { | ||
| return WinningType.THREE_MATCH; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| package strategy; | ||
|
|
||
| import vo.enums.WinningType; | ||
|
|
||
| public interface WinningPriceStrategy { | ||
| WinningType fetchWinningType(); | ||
| } |
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.
Application의 역할을 무엇으로 보셨는지 궁금합니다 :)
receivePhraseLotto,retrieveWinning등의 로직을 Application에 두신 이유가 있을까요?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.
안녕하세요 해로님! 성심성의껏 리뷰 남겨주셔서 감사해요😊
Application은 의미 그대로 애플리케이션을 구동하는 역할을 수행해야 한다고 생각해요.
그래서 위
receivePhraseLotto,retrieveWinning메서드도 보시면 Executor을 실행한 반환값을 전달해주는 메서드로 구현되었는데, 이제 보니 각 수행 동작별로 Executor를 나눠놓고 이들을 모두 Application에서 처리하려다보니 해로님의 질문이 나오게 된 것 같아요!(
receive,retrieve의미는 비슷한데 혼용해서 메서드 네이밍을 쓴 것도 지금보니 눈에 걸리는 포인트네요...😖)Uh oh!
There was an error while loading. Please reload this page.
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.
애플리케이션 '구동'을 어디까지로 볼지에 대한 정의를 먼저 내려보면 좋을 것 같아요.
지금은 구동을 넘어 사용자 입력까지 모두 처리하고 있어서, 구동의 역할을 넘어선 걸로 보이네요 :D