Conversation
jjin70
approved these changes
Dec 3, 2025
Member
jjin70
left a comment
There was a problem hiding this comment.
API 설계까지 했으니 이제 정말 끝이 보입니당 .. 다들 시험이랑 스터디 마지막까지 파이팅입니닷 ...리뷰가 늦어져 죄송합니다..
DTO: 요청/응답 받을 데이터 형식 정의Controller: 클라이언트와 통신Service: 비즈니스 로직Repository: 데이터 접근Converter: DTO 변환
이 정도로 알아두시면 될 것 같고 처음이면 기본적인 CRUD (ex)게시판 쓰기, 읽기, 수정, 삭제 등등) 구현하면서 익숙해지는 게 좋을 것 같습니다!
워크북 구조랑 다른 컨벤션도 많으니 다른 레포들도 구경하면서 구조랑 컨벤션에 대해서 알아보는 걸 추천드립니다 (예를 들어 converter를 매번 별도로 두지 않고 dto 내부에서 담당하게 하는 경우도 많습니다)
코드 보고 전체적으로 공유하면 좋을 것 같은 내용들을 아래에 공통 정리했습니다!
1. @Setter 사용은 보통 지양합니다
이건 검색하면 레퍼런스들이 많이 나오니 찾아보시면 좋을 것 같습니다
2. DTO record/class
DTO 정의 시 record와 class가 섞여 있는 경우들이 보이는데, 큰 이유가 없으면 통일해야 협업할 때 일관성이 생겨 좋을 것 같습니다. 저는 원래 class를 사용했었는데 record는 기본 제공 메서드가 있다는 걸 알게 되어 record 사용을 시작했습니다!
3. Command/Query Service
Service, CommandService, QueryService가 섞여 있거나 네이밍이 일관되지 않은 부분들이 보여서 말씀드립니다
Query: 조회 로직 (ex) MemberQueryServiceCommand: 생성, 수정 등 조회 외의 로직 (ex) MemberCommandService
서비스가 크지 않은 경우에는 분리하지 않아도 되니 컨벤션을 정할 때 고민해보고 결정한다면 좋을 것 같습니다 (사용 이유는 CQRS 패턴에 대해 찾아보시면 됩니다)
4. 정적 팩토리 메서드(of,from, toEntity 등등)와 Builder 패턴 관련해서도 공부 후에 코드에 적용해보는 걸 추천드립니다. (객체 생성 시 사용됩니다!)
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.
✅ 워크북 체크리스트
✅ 컨벤션 체크리스트
📌 주안점