Open
Conversation
dlwlals1289
reviewed
Nov 10, 2024
Contributor
There was a problem hiding this comment.
학생 정보에서 group에 대한 정보를 수정할 시 student - group 간 연관관계를 담고 기존 studentGroup 객체를 삭제하고 새로운 studentGroup을 save 하는 로직도 필요해 보입니다!
Ex) student A가 기존에는 Group A, B에 속해있었지만 Group A, C에 속해있도록 수정하려고 할 때, studentGroup (A - B)는 db에서 삭제하고 studentGroup (A-C)는 생성한다.
|
|
||
| public static UpdateStudentInfoDetailResponse of(Student student) { | ||
|
|
||
| final List<GroupInfo> groups = student.getStudentGroups() |
Contributor
There was a problem hiding this comment.
이 부분 설명 한 번 부탁드려도 될까요?
작성하신 이유가 궁금합니다!
Contributor
Author
There was a problem hiding this comment.
아 이부분은 정적 팩토리 메서드 패턴 써서, 엔티티를 response로 변환 과정을 dto 단에서 처리한거에요!
https://tecoble.techcourse.co.kr/post/2020-05-26-static-factory-method/
이부분 참조하시면 좋을 것 같습니다.
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.
Summary (작업사항)
변경사유
Reference (Wiki)
체크리스트
validation 체크 부탁드립니다.
예외 사항
기타