-
Notifications
You must be signed in to change notification settings - Fork 7
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
[BE] 나의 미팅 조회 :: 리펙터링, 쿼리최적화 #588
Open
progress0407
wants to merge
20
commits into
dev
Choose a base branch
from
feature/be/find-all-by-me
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
…RepositoryTest): recreate test
progress0407
requested review from
syoun602,
Hongdonggeon,
shindong96 and
YJGwon
November 13, 2022 11:08
📊 checkmate-sonarqube-588 분석 결과 확인하기 링크 |
YJGwon
requested changes
Nov 14, 2022
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.
쿼리와 가독성 모두 엄청 개선되었네요!! 👍 몇 가지 코멘트 확인 부탁드릴게요.
backend/src/main/java/com/woowacourse/moragora/domain/global/CompositionRepository.java
Show resolved
Hide resolved
backend/src/main/java/com/woowacourse/moragora/domain/meeting/Meeting.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/com/woowacourse/moragora/domain/meeting/Meeting.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/com/woowacourse/moragora/domain/meeting/MeetingRepository.java
Outdated
Show resolved
Hide resolved
backend/src/main/java/com/woowacourse/moragora/application/MeetingService.java
Show resolved
Hide resolved
📊 checkmate-sonarqube-588 분석 결과 확인하기 링크 |
리뷰 반영했어요 :) 천천히 확인 하면 될 것 같아요 |
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.
Close #507
PR 타입
반영 브랜치
feature/be/find-all-by-me
->dev
요구사항
/meetings/me
변경사항
CompositionRepository
도입성능 최적화를 고려하면서 엔티티를 조회할 경우, 단순히 조회하여 조립하는 것 뿐인데
흐름이 복잡해서 파악하는 게 힘든 경우가 있었어요.
따라서 Service <-> Repository간에 중간 Repository를 하나 두어 (
Facade Pattern
) 생성 로직을 응집했어요.이 Repository의 역할은 아래와 같아요.
아무래도 일반 DTO를 반환하다 보면
미팅별 지각횟수 조회
란 개념이 엔티티가 아닌 각 API별 ResponseDTO로 중복됩니다. 따라서 반환 타입을 엔티티로 잡았습니다.중간 Repository Layer가 하나 더 있기 때문에, Meeting의 Repositroy <-> Entity간 DTO(
지각횟수
)를 의존성을 이곳에서 제거할 수 있습니다.나의 미팅 조회 API
의 호출과정에서 일급 컬렉션을 의존하는 로직을 제거했어요.쿼리 5번이 나가는 이유
Meeting + Participant 조회 (fetch join)
1
번1
번1
번5번: 1 + 2 * (1+ 1)
리펙터링 전/후 코드 (Service Layer 중심)
리펙터링
전
리펙터링
후
쿼리 최적화
최적화 전
최적화 후
논의하고 싶은 내용
MeetingAttendances 검증 제외와 이유
현재 Jacoco 유효성 검증에
Branches
가 0.8로 되어있는데이 Branches는 분기문에 따른 테스트 커버리지를 측정하고 있어요
그러나 테스트를 추가했음에도 불구하고 0.75가 나오는데... 그 이유를 잘 모르겠네요 ㅠ,
(테스트를 추가했지만 branches 커버리지가 올라가진 않았네요!!)
곧 사라질 클래스이기도 하고 (ParticipantAttendances와 함께)...
MeetingAttendances를 검증 대상에서 배제하는 것에 대해 제안합니다. ㅠ