-
Notifications
You must be signed in to change notification settings - Fork 20
[김승환] 에러 케이스 수정 #251
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
Merged
Merged
[김승환] 에러 케이스 수정 #251
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.
완료 작업 목록
기능요구사항
프로그래밍 요구사항
figma 요구사항
주요 고민과 해결 과정
에러 케이스 수정
대문자 확장자로 되어 있는 값을 받을 수 있도록 대소문자를 무시하고 비교가 가능하도록 수정하였습니다.
DDD 적용해보기
지하철에서 도메인 주도 개발 시작하기 책을 읽으면서 왔는데, 내 코드에는 어떻게 적용할 수 있을지 고민했습니다.
유저가 자신의 비밀번호와 아이디를 변경하는 로직에서 정책상 비밀번호 및 닉네임은 4글자 이상이어야 하며, 중복되면 안된다는 정책을 도메인 내부에서 해결할 수 있도록 하였습니다.
그러나 그렇게 되면 중복 확인을 위해 유저 엔티티가 Repository를 들고 있어야 하는 상황이 있었는데, 이를 유저가 닉네임 또는 패스워드를 변경할 때, 레포지토리를 가지고 있는 정책을 같이 파라미터로 넣어줌으로써 User Domain 내부에서 자신의 정책을 정의하고 수행하는 책임을 부여할 수 있었습니다.
이로 인해 혹여나 다른 서비스 로직에서 닉네임을 변경하더라도 새로운 정책을 다른 서비스 로직에서 똑같이 적용하지 않습니다.
도메인 내부에서 정책을 가지고 닉네임 변경과 비밀번호 변경을 하는 책임을 가지기에 다른 서비스로직에서 이 정책을 신경 쓸 필요가 없어졌기에 확장시에 정책을 실수하는 등의 오류를 줄일 수 있을 것으로 판단합니다.