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? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
✨ [Feature/room] implement create room #30
✨ [Feature/room] implement create room #30
Changes from all commits
1400fb8
bbc55db
9023093
155e16d
a7866b6
1c8e27a
f9137f4
8d23483
b6f3d34
ab0d593
5a68b5c
534b14b
a19ca80
421183f
210cd0d
8bdb2b7
19680a1
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
This file was deleted.
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.
redis는 api 모듈에서 사용하는 것 같은데, core 모듈에 추가한 이유가 궁금해요~
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.
저희가 도메인과 엔티티를 따로 분리하지 않고 같이 쓰기로 했었다보니 core 모듈에서도 redis 관련 애노테이션이 쓰일 수 있어 core 모듈에 추가했어요~
예를 들어 Room 객체를 Redis에 hash 타입으로 저장하는 것 등으로 바꾼다면
이렇게 쓰이게 되어 core 모듈에 추가했었습니다 😄
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.
생성자가 아닌 정적 팩터리 메서드로 분리한 이유가 궁금합니다!
VO를 분리하여 검증 책임을 적절히 위임한다면 주생성자 - 부생성자 형식으로 생성자 체이닝도 가능할 것 같아요!
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.
주생성자 - 부생성자 형식으로도 구현해서 검증은 부생성자에 위임하는 방식으로 생성자 체이닝 방식도 좋지만, 정적 팩토리 메서드로 구현하는 것이 몇가지 더 장점이 있다고 생각했어요.
this(roomName, password)
,this(roomName, password, hostProfile)
, ... 처럼 부생성자가 많아지는 경우 어떤 목적인지 명확히 알기 어렵고, 매개변수가 타입은 같은데 한두개 순서만 다른 경우 다른 사람이 잘못 사용할 수도 있음이펙티브 자바에도 비슷한 내용이 나오는데 이외에도 장단점이 더 있지만 정적 팩터리 메서드가 좀더 낫다고 생각했습니다 😄