-
Notifications
You must be signed in to change notification settings - Fork 467
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
[2단계 - 블랙잭 베팅] 미미(홍향미) 미션 제출합니다 #888
Open
hongkikii
wants to merge
116
commits into
woowacourse:hongkikii
Choose a base branch
from
hongkikii:step2
base: hongkikii
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- 추가 블랙잭 게임 요구사항 정리
- Hand 상태(버스트, 블랙잭, 점수 비교 필요)에 따라 승패 결정하는 인터페이스 및 구현체 구현
- 패키지 구조 변경
- 사용자 상호작용 로직 => BlackjackGame - 실제 게임 실행 로직 => GameTable
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
체크 리스트
test
를 실행했을 때, 모든 테스트가 정상적으로 통과했나요?객체지향 생활체조 요구사항을 얼마나 잘 충족했다고 생각하시나요?
1~5점 중에서 선택해주세요.
선택한 점수의 이유를 적어주세요.
메서드의 최대 길이를 초과하였거나, 몇몇 지키지 않은 부분이 있습니다.
어떤 부분에 집중하여 리뷰해야 할까요?
안녕하세요, 범블비!🙇🏻♀️
step2에서는 step1 피드백, step2 기능 요구사항과 더불어
객체 지향이 말하는 원칙들을 지켜보며 장단점이 뭔지 느껴보려 했었어요!
1. 불변 객체 사용
객체의 상태가 바뀐다면 새로 객체를 생성해서 반환하려 했어요.
상태가 어디서 바뀔지 신경을 안쓸 수 있어서 좋았던 거 같아요.
그리고 테스트 코드에서 객체끼리의 비교가 더 용이해진 것 같아요! (테스트하기 더 좋아졌어요)
다만, 항상 객체를 생성해주니 그만큼 비용이 증가할 것 같다는 생각이 들었고,
복잡하지 않은 상황에서는 단순히 상태를 변경해주는 것이 더 간단할 수도 있을 것 같았어요.
그리고 상태가 바뀔 때마다 객체를 생성해주긴 했지만, 딜러랑 플레이어를 선언해주고 바뀐 객체를 끼워줄 곳은 필요하다 생각했어요!
GameTable 클래스가 이 역할을 맡았어요.
2. 상태 객체 사용
수업에서 상태를 객체로 표현할 수 있다는 걸 배워서 적용해봤어요.
확실히 분기가 많아지면 각 상태별로 객체를 생성했을 때 가독성이 좋아질 것 같다는 생각이 들었어요!
하지만 제가 다루는 코드의 복잡도에서는 선택 사항 같았어요.
3. 객체 중심적 사고
모든 클래스를 하나의 객체로써만 보려고 노력했어요.
그래서 View나 Controller 같은 네이밍을 사용하지 않았어요.
실제 제 클래스가 View나 Controller가 아닌데 그런 네이밍을 사용하고 있더라구요!
(클래스별 역할은 리드미에 정리해뒀어요😃)
다만, 입출력과 게임 관련 로직은 분리하는 게 맞다는 생각이 들어서 (언제나 콘솔을 쓸 건 아닐거 같아서..)
이 원칙은 지키려고 노력했어요!
감사합니다 :)