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.
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
[5기]3주차 Wordle 과제 제출 - 싸무엘 #36
base: main
Are you sure you want to change the base?
[5기]3주차 Wordle 과제 제출 - 싸무엘 #36
Changes from 50 commits
8ab95e6
5c69323
0517eb1
334e123
bbc2280
61fae53
4061d64
742ebd5
005e447
7d2e79f
eb5ee89
d960b50
883e63a
318426a
b300bc1
bd4c2cb
22eecf7
e51a0a8
36173d7
84f1a55
15baf55
b158817
07007a6
aaf2b6e
7ae7c87
47a549c
7d091de
d3ad606
fbe067c
3860bac
8cb9ade
46d72cd
08fc345
4fc87cf
1aae120
cffb677
438f7b0
cdaea0b
b3d5b05
2273c00
f6f55e1
0132097
e071b7f
bbaa42c
d62deea
02d8987
bf05504
4b15342
4f208b2
518e295
3ed7bc0
d1dffe5
dca9adb
c5bef02
4f35990
1d3cbef
e3b2d12
28ea8ec
f73a128
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
회고를 잘 정리해주셔서 어떤 과정으로 구현했고, 변경했는지 따라가기가 좋았습니다! 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wordle을 생성하는 시점에 변수를 넘겨서 생성하고 계신데
new Wordle()
로 생성하시고 wordle 안에서 의존성을 관리하는 것은 어떨까요? 🤔여러 변수를 넘겨받는 생성자는 코드를 실행하는 시점에 동적으로 변수를 변경할 수 있다는 장점이 있지만 해당 소스에서는 동적인 변화가 필요하지 않을 거 같아 생성의 책임을 wordle 안으로 넘긴다면 의존성이 추가될 때 wordle 클래스만 수정해도 되지 않을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
말씀해주신 장점을 생각해 주입 패턴을 사용했는데, 현재 Wordle 에서는 동적으로 바뀌지 않아 Wordle 클래스 내부에서 생성 책임을 가져가도 괜찮을 것 같기도 하네요 🤔
생각해보니 동적으로 바뀌어야할 상황을 가정한다면 추상화를 하는게 좋아보이네요,, 당연하게 생각하고 넘어갔었던 부분인데 상기 시켜주셔서 감사합니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
메소드 배치하실 때 어떤 기준으로 하시는 편인지 궁금합니다!
저도 피드백 받은 부분인데
상수 -> 일반 필드 -> 기본 생성자 -> 인자가 있는 생성자 -> public 메소드 -> private 메소드 -> 오버라이딩한 메소드 순
으로 배치하는 것을 추천해 주시더라구요.이번 기회에 같이 전체적으로 적용해보면 좋을 거 같아요~~ 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public 메서드, private 메서드는 순서상관없이 연관성 있는 메서드끼리 묶어놓는 편이고, 다른 순서는 동일해요!
public 메서드와 참조하는 private 메서드의 거리가 멀 때 확인이 불편해서 최대한 가깝게 놓는 편이에요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
철자와 위치를 Map으로 사용하셨군요! 흥미롭습니다!! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
철자와 철자 개수를 각각 Map의 key, value로 만들었어요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
소문자로 변환하는 작업이 있어 안정적이네요! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
대소문자 비교때문에 소문자로 변환해야겠다고 생각해서 추가했는데, 얄뭉님은 대소문자 구분을 어떻게 하셨을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collectors.joining을 사용해 깔끔하네요! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저는 joining을 처음 써봤는데 이번에 딱구님에게 배웠습니다 ㅎㅎ 🚌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
값만 일치하는 경우를 판단하는 메서드가 Letter에 있으면 책임이 분리되어서 좋을거 같아요~🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻 Letter에 책임 부여하는 게 더 좋아보이네요 👍🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Set을 사용해서 중복을 방지하고 O(1)의 시간 복잡도로 검색 속도가 향상되겠네요!
한 수 배워 갑니다~ 😚
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
해당 클래스명도 다른 도메인처럼 가시적인 클래스명으로 변경하면 더 좋을거 같습니당!🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
정답-입력 문자를 비교해서 결과를 도출하는 책임을 어디에 부여하면 좋을까 고민하다가 이 클래스를 만들게 되었어요.
지금 다시 봐도 역할이 참 모호한 것 같네요..ㅋㅋ 리팩토링 포인트로 놓고 고민해볼게요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TileService -> LetterComparator로 좀 더 가시적?으로 변경했어요. 네이밍 어떠신지요 ㅋㅋ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
서비스에서는 전체가 정답타일인지 물어보는 메소드를 호출하고, isFilledWith(ANSWER_TILE)를 tiles 안에서 호출하도록 하는 건 어떨까요?
그러면 서비스에서 ANSWER_TILE을 매개변수로 쓰지 않아도 될 거 같아 제안드려 봅니다~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiles가 정답(ANSWER_TILE)에 대해 알 필요가 있을까 생각해서 해당 책임을 부여하지 않고 파라미터로 넘겼어요.
이름 때문에 관련 기능만 제공해야겠다는 생각을 해서 이렇게 구현했는데, 이 부분도 TileService 와 함께 고민해볼게요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiles -> Result 클래스로 변경해서 isAnswer() 책임을 Result 클래스로 위임했습니다! 그래서 이 메서드는 삭제되었어요.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
변경이 불가능하도록 구현하신 부분이 좋네요! 👍