Conversation
- infrastructure 상위 패키지 추가로 순수 도메인과 JPA 분리
blue000927
reviewed
Jan 12, 2026
Comment on lines
+10
to
+15
| @RequiredArgsConstructor | ||
| public class UserRepositoryImpl implements UserRepository { | ||
|
|
||
| private final JpaUserRepository jpaUserRepository; | ||
|
|
||
| } |
There was a problem hiding this comment.
UserRepository 하위에 R2dbcUserRepository, JpaUserRepository, ... 요런 구조를 생각했어요!
JPA CRUD를 위해 필요한 Interface는 JpaUserRepository 하위에 내부 클래스로 정의하면 어떨까요?
네이밍은 하기 나름인데 어차피 내부에서만 쓰는 클래스니까 UserRepositoryAdapter 요런 네이밍을 쓰셔도 되고 좀 자유롭습니다.
저랑 같이하셨던 멘티분은
- domain: UserRepository
- infra
- JpaUserRepository implements UserRepository
- UserEntityRepository extends JpaRository<UserEntity, Long> (JpaUserRepository 하위)
요렇게 네이밍 지었었습니다!
Collaborator
Author
There was a problem hiding this comment.
아, 이해했습니다! 제안해주신 방법 도메인 순수성 유지 측면에서 좋은거같습니다. 네이밍은 UserEntityRepository로 수정하고, 내부로 정의해서 반영하겠습니다~
Comment on lines
+3
to
+4
| public interface UserRepository { | ||
| } |
There was a problem hiding this comment.
(참고) 여기에 추후 infra crud에서 활용될 인터페이스 명세가 들어감
There was a problem hiding this comment.
또한 여기는 도메인 interface이므로 crud 파라미터와 응답 타입은 도메인 타입이 됩니다.
가령, public User save (User user) 요런 형태입니다.
따라서 infra 레이어에서 도메인 -> 엔티티, 엔티티 -> 도메인 바꾸는 과정이 생깁니다.
There was a problem hiding this comment.
blue000927
approved these changes
Jan 12, 2026
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.
개요
메인 리뷰어 지정
리뷰 시 참고 사항
TODO
References
체크리스트
관련 이슈