-
Notifications
You must be signed in to change notification settings - Fork 120
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_나제법_1주차 과제(3단계) #173
Open
nove1080
wants to merge
119
commits into
kakao-tech-campus-2nd-step2:nove1080
Choose a base branch
from
nove1080:step3
base: nove1080
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
동일한 역할의 다른 이름을 가진 클래스 구현 예정
Long -> UUID
아이디가 같으면 같은 객체로 인식
web 패키지의 하위 패키지로 이동
findAllProducts -> readAllProducts 메서드 네이밍 통일을 위함
delete -> deleteById
private -> protected
CreateRequestToProductConverter 사용 대신 dto가 직접 Entity로의 변환 책임을 가진다
dto에서 변환 작업을 수행하도록 변경되어 사용하지 않는 클래스
dto에서 변환 작업을 수행하도록 변경되어 사용하지 않는 클래스
domain과 view의 분리를 위함
ProductUpdateParam -> Product
ProductUpdateParam -> Product
사용되지 않음
UpdateProductFromDto -> ReadProductResponse 사용
Product(String name, Integer price, String imageUrl) {
validateName(name);
validatePrice(price);
validateImageUrl(imageUrl);
} |
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.
코드 작성하면서 어려웠던 점
URL을 다루는 부분에서 객체와 테이블 간의 타입 차이가 있어서 둘을 서로 변환하는 과정이 좀 번거로웠습니다. 객체에도 DB와 동일하게 String 타입으로 URL을 다루었어야 하는지 잘 모르겠습니다. 제가 생각했을 때에는 자바에는 URL을 다루기에 적합한 데이터 타입이 이미 있지만 String을 사용해서 해결하여야 하는지 아니면 아래와 같은 컨버터를 두어서라도 URL로 다루는 것이 적절한 선택이였을지 잘 모르겠습니다.
코드 리뷰 시, 멘토님이 중점적으로 리뷰해주셨으면 하는 부분
Repository
의 상품 저장 메서드에서 반환값으로 상품을 식별할 수 있는 ID값을 반환하려 했지만 현재 메서드에서 상품의 ID가 설정되기 전이라 null값이 반환되는 문제가 있었습니다.Product
테이블을 위와 같이 ID를AUTO_INCREMENT
로 선언하여 실제 DB에 Insert가 되기 전까지는 해당 레코드의 아이디를 알 수 없기 때문에 일단은 save()의 반환값을 사용하는 부분은 없어서 그대로 두었습니다 ID를 가져오기 위해 다시 DB에 조회 쿼리를 보내서라도 해결하는 것이 나았을지는 잘 모르겠습니다 ㅜㅜ