[황인규] 연료 주입, blackjack (Step1) - #41
Open
sk11ingyuhwang wants to merge 82 commits into
Open
sk11ingyuhwang wants to merge 82 commits into
sk11ingyuhwang wants to merge 82 commits into
Conversation
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.
안녕하세요. 🙇♂️
이번 미션에서는 연료주입, 블랙잭에 대해 구현했습니다.
이번 미션에서 집중한 내용은
공통 기능에 대해서 인터페이스와 필요하다면 추상클래스를 적절히 묶어서 구현체로 구현해 보았어요.한일
연료주입 🚐
연료주입에서는 추상 메서드를 하나 이상 가지고 있는Car클래스를 기반으로K5, Sonata, Avante를 만들어주었어요.입력 값에 따라서 자동차 객체를 생성해줘야 하는 부분을 어떻게 구현해줘야 할지 고민이 많았어요.
이 부분은 페어와 의견을 공유해보면서
아래 of 메소드를 활용해 자동차 이름과, 거리를 입력 받으면 알맞은 자동차 객체를 반환하도록 만들어 보았어습니다.블랙잭 🎴
블랙잭에서는 공통 기능을 분류하는 작업을 우선 고민해보았어요.어떤 부분이 필요할지 몰라
블랙잭을 우선 먼저 구현해보고 필요한 기능을 엮어보았습니다.아래 6가지가 공통된 기능을 수행하고 있었어요.
interface
위 interface 기능에서 관련된 것끼리 abstract으로 묶었어요.
abstract
또, 인터페이스를 활용해보니 저수준 모듈에서 고수준 모듈을 의존하게끔 바꿈으로써 구현 변경 및 테스트 어려움을 해결할 수 있었어요.
질문
이 글 을 읽어보고 interface와 abstract을 활용했는데 블랙잭에 필요한 공통 기능을 잘 나누었는지 리뷰어님께 확인받고 싶어요.
객체간에 의존 관계가 깊어져서 getter() 를 여러번 타게 되는 경우가 많이 발생했어요. 불필요한 객체를 만든건 아닌지 무척 걱정이 됩니다.
Winner클래스에Game객체를 들고 있는것이 맞는지 확신이 안들어요.Winner클래스의 역할을Winner를 가리기 위한 책임을 가지고 있는 클래스라고 생각했어요. 그래서Game을 함으로써Winner를 보여준다. 는 행위를 수행하는 역할을 하게 되는데요. 이 부분에 대해서 리뷰어 님의 생각이 궁금해요. 🙇♂️