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

[둘리] 2단계 블랙잭 제출합니다. #35

Merged
merged 61 commits into from
Mar 10, 2023

Conversation

hyemdooly
Copy link

안녕하세요, 리뷰어님! 1단계 피드백을 반영하고 2단계 기능을 구현하였습니다.
제가 봐도 아직 코드가 부족하다고 생각하는데, 혼자 고민해도 어려워서 질문드립니다!

  1. 객체가 일을 해야한다고 생각해서 Player에 판단하는 기능을 넣었는데, judge 함수를 따로 다른 클래스에 빼는 것이 좋을까요?
  2. 컨트롤러나 테스트코드에서 초기화하는 코드가 너무 복잡한 경우 DSL을 이용한 빌더를 작성해주는 것이 좋을까요? (Ex. Controller의 initBetInfo)
  3. CardGame과 컨트롤러의 경계를 어떻게 지어야할지 감이 잘 안옵니다.
컨트롤러가 되도록 로직을 몰라야한다고 생각해서 CardGame에 분리하여 작성하려고 노력했는데요. 게임 진행 중 View가 필요한 순간이 계속해서 등장해서 어렵습니다. ㅠㅠ

    다른 크루들의 의견을 들어보니 CardGame에 View의 함수를 인자로 넘겨주었다고 하는데요.
    저는 도메인에서 View의 함수를 사용하는 일은 피해야한다는 입장입니다!
 도메인에서 View의 함수를 사용하는 것이, 도메인에서는 View에서 오는 함수인지 모른다고 할지라도 MVC에 위배되지 않는건가요?

@hyemdooly
Copy link
Author

hyemdooly commented Mar 9, 2023

피드백을 반영하면서 컨트롤러를 크게 고쳤습니다!
컨트롤러는 게임의 로직을 되도록 몰라야한다고 해서, CardGame에 모든 로직을 구현하고 InputView와 OutputView의 함수를 넘겨주어 고차함수를 쓰는 방식을 사용했는데요.
기존 방법이 더 좋은지, 지금 방법이 더 좋은지 궁금합니다.
추가로 더 개선될 수 있는 부분이 있다면 피드백 부탁드립니다. 감사합니다! :)

Copy link

@galcyurio galcyurio left a comment

Choose a reason for hiding this comment

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

피드백 잘 반영해주셨네요 👍
마지막으로 재입력 받는 기능을 UI layer로 옮겨보고 끝내보면 좋겠습니다.

src/main/kotlin/model/participants/Participants.kt Outdated Show resolved Hide resolved
src/main/kotlin/model/result/GameResult.kt Outdated Show resolved Hide resolved
src/main/kotlin/domain/CardGame.kt Outdated Show resolved Hide resolved
src/main/kotlin/domain/CardGame.kt Outdated Show resolved Hide resolved
src/main/kotlin/domain/CardGame.kt Outdated Show resolved Hide resolved
Copy link

@galcyurio galcyurio left a comment

Choose a reason for hiding this comment

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

지금까지 블랙잭 미션 고생하셨습니다 👏
조금 어려운 피드백도 있었는데 잘 반영해주셨어요 👍
다음 미션도 힘내세요!

@galcyurio galcyurio merged commit cfcbaeb into woowacourse:hyemdooly Mar 10, 2023
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