-
Notifications
You must be signed in to change notification settings - Fork 170
[Spring MVC] 김태우 3,4단게 미션제출합니다. #518
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
Open
tae-wooo
wants to merge
19
commits into
next-step:tae-wooo
Choose a base branch
from
tae-wooo:roomescape-taewoo
base: tae-wooo
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 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.
상희님 안녕하세요! 이번에도 잘 부탁드립니다🙏
이번 미션은 step 3 - 예약 추가 / 취소, step 4 - 예외 처리 입니다!
궁금한 점
이번 미션도 저번 미션과 마찬가지로 아직 DB를 사용하지 않는 구조이다 보니,
처음에는 더미 데이터를 미리 넣어두고 2단계 조회 테스트를 통과시켰습니다.
하지만 더미 데이터를 그대로 둔 상태에서는 3단계(예약 생성/삭제) 테스트가 실패했고,
반대로 더미 데이터를 제거하면 2단계 조회 테스트가 실패하는 상황이 발생했습니다.
이런 경우, 더미 데이터를 유지하면서도 2단계와 3단계 테스트를 모두 통과시킬 수 있는
접근 방식이 있을지 궁금합니다.
현재 Controller에서는 정상 응답은 HTML 또는 JSON으로 반환하고 있지만,
예외 상황에서는 GlobalExceptionHandler에서 문자열(String)로 메시지를 반환하고 있습니다.
일반적으로 예외도 JSON 형태로 응답하는 경우가 많은 것으로 알고 있는데,
이 프로젝트에서도 예외 응답을 JSON으로 통일하는 것이 더 나은 방향인지 궁금합니다.
현재 Reservation 도메인 내부에서 name/date/time에 대한 검증을 수행하고 있습니다.
그런데 나중에 @Valid와 Bean Validation을 활용하면 DTO에서도 검증이 가능하다는 것을 알게 되었습니다.
단순히 값이 비어 있는지 확인하는 정도의 검증이라면 DTO에서 처리하는 것이 더 자연스러운지,
아니면 도메인에서 검증하는 현재 방식도 충분히 괜찮은지 고민이 됩니다.
검증 책임을 DTO와 도메인 중 어디에 두는 것이 더 좋을지 의견이 궁금합니다.