Skip to content

Commit 471668e

Browse files
authored
Step3 - 로또(2등) (#4217)
* refactor: 3단계 로또(2등) - 피드백 받은 부분개선 - BeforeNum 을 도입한 '확장성'은 당장 불필요하다고 판단 -> Lotto로 변환 - Lotto 생성자 유효성 검사 추가 - LottoFactory과 LottoMachine이 비슷한 역할을 한다고 판단해 팩토리 삭제 - 컨트롤러 역할인 LottoStore 의 협력구성의 가독성 개선 * feat: 3단계 로또(2등) - 보너스볼 요구사항 추가 - 당첨번호 vs 로또번호 로 등수결과 추출 로직에 보너스볼 추가되게 변경 및 테스트 - WinStandard에 2등관련 작업 추가 - WinStandard findByValue 에 보너스볼 여부 파라미터 추가 - WinStandard 테스트코드 추가 * refactor: 3단계 로또(2등) - 추가 요구사항에 따른 관련 객체 캡슐화 => WinnerResult 객체의 필드를 List -> Map으로 변경 및 분산되어 있던 당첨결과 로직을 WinnerResult로 응집 - 관련해서 불필요한 클래스와 일부 협력 플로우 변경 * refactor: 3단계 로또(2등) - lottoGame 패키지명을 lottogame로 개선 - 당첨번호,보너스볼을 관리하는 WinningLottoNums 객체 생성 - 당첨결과 추출하는 행위를 Lotto에서 WinningLottoNums로 이관 * refactor: 3단계 로또(2등) - WinStandard 의 UI 메세지를 Casher 클래스로 위임 - UI 위임으로 인한 LottoStore 내 메서드 제거 - WinnerResult 초기화 로직 캡슐화 * refactor: 3단계 로또(2등) - Lotto의 필드값을 List에서 Set으로 변경 - UI 노출 부분도 정렬된 List 출력으로 개선 * refactor: 3단계 로또(2등) - WinningLottoNums 부생성자 추가 - 피드백기반으로 WinnerResult.calculateRateOfReturn()는 단일책임원칙을 위반한다고 판단되어 로직 분리 - 중복 상수값 삭제 * refactor: 3단계 로또(2등) - 인스턴스 과부하 방지를 위한 static LottoNum 객체풀 생성 - 당첨번호와 보너스볼 중첩 예외처리
1 parent de169d7 commit 471668e

38 files changed

+766
-646
lines changed

src/main/java/lottoGame/controller/LottoStore.java

Lines changed: 0 additions & 61 deletions
This file was deleted.

src/main/java/lottoGame/model/lotto/Lotto.java

Lines changed: 0 additions & 46 deletions
This file was deleted.

src/main/java/lottoGame/model/lotto/LottoMachine.java

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/main/java/lottoGame/model/lotto/LottoNumFactory.java

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/main/java/lottoGame/model/winner/BeforeWinNums.java

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/main/java/lottoGame/model/winner/WinStandard.java

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/main/java/lottoGame/model/winner/WinnerResult.java

Lines changed: 0 additions & 49 deletions
This file was deleted.

src/main/java/lottoGame/view/Casher.java

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/main/java/lottoGame/view/WinResultDto.java

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/main/java/lottoGame/Application.java renamed to src/main/java/lottogame/Application.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package lottoGame;
1+
package lottogame;
22

3-
import lottoGame.controller.LottoStore;
3+
import lottogame.controller.LottoStore;
44

55
public class Application {
66

0 commit comments

Comments
 (0)