Open
Conversation
This file contains hidden or 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
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.
안녕하세요 준수님!! 저번 미션에 이어 또 만나게 되었네요 !! 이번 미션도 잘 부탁드립니다.🙇♀️
해결했습니다!!
-------------/
본론으로 돌아와서 제 코드에 대해 설명을 드리자면
입니다!
궁금한점
이번에는 다른 미션들과 다르게, controller에서 OutputView, InputView만이 아니라 model인 LadderFactory도 Controller 필드(private final~~ = ) 로 선언했습니다. LadderFactory는 사다리를 만드는 도구이지 실제 사다리가 아니므로 view처럼 재사용해도 괜찮다고 생각했습니다. 따라서 매번 new LadderFactory()를 호출하는 것보다 하나의 인스턴스를 재사용하는 것이 더 적절하다고 판단해서 이렇게 선언했는데 이 판단이 적절한지 궁금합니다.
현재 제 코드에서는 LadderGame의 메서드를 호출할 때마다 participants와 results를 매개변수로 계속 넘겨주고 있습니다. LadderGame뿐만 아니라 getResult, playAll을 부를때도 매번 같은 데이터를 전달하고 있는데 이게 불필요한 반복이라는 생각이 들었습니다. 그래서 이 데이터들을 밑에 코드처럼 LadderGame의 생성자에서 한 번만 받아서 필드로 저장하면 어떨까 고민했습니다. 그렇게 하면 메서드를 호출할 때 매개변수를 넘기지 않아도 되어 코드가 더욱 간결해질 것 같습니다. 하지만 반대로 LadderGame이 너무 많은 책임을 가져가는 듯한 느낌 또한 들었습니다. 준수님이라면 어떤 방식이 더 좋을 것 같은지 조언 부탁드리겠습니다.!!
항상 리뷰해 주셔서 감사합니다😊