Commit 471668e
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
File tree
38 files changed
+766
-646
lines changed- src
- main/java
- lottoGame
- controller
- model
- lotto
- winner
- view
- lottogame
- controller
- model
- lotto
- price
- winner
- view
- test/java
- lottoGame
- fixture
- model
- lotto
- winner
- lottogame
- fixture
- model
- lotto
- price
- winner
38 files changed
+766
-646
lines changedThis file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments