Open
Conversation
변경이 필요한 부분은 변경해주시면 될 것 같아요~! 😄 |
sihoony
requested changes
Feb 18, 2025
sihoony
left a comment
There was a problem hiding this comment.
안녕하세요~!
이번 미션을 잘 수행해주셨네요~! 👍
간단한 코멘트 남겼으니 확인해주세요. 즐거운 하루 되세요~! 😄
| private UUID id; | ||
|
|
||
| @Embedded | ||
| private ProductName name; |
| return id; | ||
| } | ||
|
|
||
| public void setId(final UUID id) { |
There was a problem hiding this comment.
Setter를 의미있게 변경해보면 어떨까요?
단순 Setter가 필요없다면 다른 방식으로 풀어보는 것도 좋을 것 같네요~! 😄
Author
There was a problem hiding this comment.
Product의 ID만을 세팅하는 경우는 없고, 생성하기 위해서 이름, 가격을 주입 받고 있습니다!
제거하고 생성자로 생성하는게 나을 것 같아요
Comment on lines
+19
to
+33
| public ProductName(String name, PurgomalumClient purgomalumClient) { | ||
| validate(name, purgomalumClient); | ||
| this.name = name; | ||
| } | ||
|
|
||
| public void validate(String name, PurgomalumClient purgomalumClient) { | ||
| if (Objects.isNull(name) || name.trim().isEmpty()) { | ||
| throw new IllegalArgumentException(); | ||
| } | ||
|
|
||
| if (purgomalumClient.containsProfanity(name)) { | ||
| throw new IllegalArgumentException(); | ||
| } | ||
| this.name = name; | ||
| } |
Comment on lines
+43
to
+54
| @Override | ||
| public boolean equals(Object o) { | ||
| if (this == o) return true; | ||
| if (o == null || getClass() != o.getClass()) return false; | ||
| ProductName that = (ProductName) o; | ||
| return Objects.equals(name, that.name); | ||
| } | ||
|
|
||
| @Override | ||
| public int hashCode() { | ||
| return Objects.hashCode(name); | ||
| } |
| import java.util.Objects; | ||
|
|
||
| @Embeddable | ||
| public class Price { |
Comment on lines
+46
to
+48
| public void setPrice(BigDecimal price) { | ||
| this.price = price; | ||
| } |
There was a problem hiding this comment.
VO는 immutable 해야하는데, VO을 변경하는 setPrice가 필요할지 고민해보면 좋을 것 같아요~!
Author
There was a problem hiding this comment.
네넵! 불변이라 새로 생성하는 방법으로 로직 및 테스트가 되어있습니다! 제거하겠습니다
Comment on lines
+39
to
+41
| public void setName(String name) { | ||
| this.name = name; | ||
| } |
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.
안녕하세요!
이전 단계가 마무리 되지 않아, 예시 코드로 진행했습니다!
테스트 tobe아래에 생성해서하는데도, 있던 테스트들이 꽤나 변경해야하더라구요, 이 경우에는 전부다 변경하면서 진행하는게 맞을까요??
확인 부탁드립니다.