Open
Conversation
혁 레이싱 게임 브랜치 머지 fork/yh -> original/yh
pci2676
requested changes
May 14, 2020
Member
pci2676
left a comment
There was a problem hiding this comment.
특정 행동을 하는 상태값들을 한곳에서 같이 처리할 수 있도록 응집도를 올려보자
Comment on lines
+34
to
+40
| int maxDistance = racingTurns.getMaxDistance(); | ||
| List<Integer> lastTurnCarDistances = racingTurns.getLastTurnCarDistances(); | ||
| return IntStream.range(0, carNames.size()) | ||
| .boxed() | ||
| .filter(i -> lastTurnCarDistances.get(i) == maxDistance) | ||
| .map(i -> carNames.get(i)) | ||
| .collect(Collectors.toList()); |
Member
There was a problem hiding this comment.
Winner는 distance와 name으로 결정되는데 그 상태들이 서로 따로 행동하고 있어
나느 응집도가 떨어지는것으로 보이는데 이 상태값들을 하나로 관리할 수 있는 방향으로 리팩토링을 다시 해보면 좋을 것 같아
그렇게 되면 여러 책임이 다른 객체에게 위임될 수 있을것 같아
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.
original / yh -> original / master PR