-
Notifications
You must be signed in to change notification settings - Fork 164
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
Step2 리펙터링(메뉴) 입니다. #103
Open
BaekSeungYeol
wants to merge
7
commits into
next-step:baekseungyeol
Choose a base branch
from
BaekSeungYeol:step2
base: baekseungyeol
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
Step2 리펙터링(메뉴) 입니다. #103
Changes from 5 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
79ab5a3
test: Domain Menu 테스트 코드 추가
BaekSeungYeol 58c444b
feat: tobe Menu 원싯값 포장 및 분리
BaekSeungYeol cfead46
refactor: Menu 컨텍스트와 Product 컨텍스트 분리
BaekSeungYeol 80e18e5
feat(Value) : Value 클래스 추가
BaekSeungYeol a59b011
refactor: Menu 생성자 접근 제어자 변경
BaekSeungYeol 1b6038e
chore: 오타 제거
BaekSeungYeol 69f6c8d
feat: Value object 명시
BaekSeungYeol File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...s/products/tobe/domain/DisplayedName.java → ...ducts/tobe/menu/domain/DisplayedName.java
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
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
2 changes: 1 addition & 1 deletion
2
...enpos/products/tobe/domain/MenuPrice.java → .../products/tobe/menu/domain/MenuPrice.java
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
2 changes: 1 addition & 1 deletion
2
...pos/products/tobe/domain/MenuProduct.java → ...roducts/tobe/menu/domain/MenuProduct.java
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
6 changes: 4 additions & 2 deletions
6
...os/products/tobe/domain/MenuProducts.java → ...oducts/tobe/menu/domain/MenuProducts.java
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
2 changes: 1 addition & 1 deletion
2
...pos/products/tobe/domain/Profanities.java → ...roducts/tobe/menu/domain/Profanities.java
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
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
5 changes: 3 additions & 2 deletions
5
...pos/products/tobe/domain/ProductName.java → ...ucts/tobe/product/domain/ProductName.java
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
6 changes: 4 additions & 2 deletions
6
...os/products/tobe/domain/ProductPrice.java → ...cts/tobe/product/domain/ProductPrice.java
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package kitchenpos.products.tobe.support; | ||
|
||
import java.util.Arrays; | ||
import java.util.Objects; | ||
|
||
public abstract class Value<T extends Value<T>> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 추상화를 잘 표현해주셨어요 👍
|
||
|
||
public boolean equals(final Object o) { | ||
if(this == o) return true; | ||
if(o == null || getClass() != o.getClass()) return false; | ||
|
||
return Arrays.stream(getClass().getDeclaredFields()) | ||
.allMatch(field -> { | ||
field.setAccessible(true); | ||
try { | ||
return Objects.equals(field.get(this),field.get(o)); | ||
} catch (IllegalAccessException e) { | ||
e.printStackTrace(); | ||
return false; | ||
} | ||
}); | ||
} | ||
|
||
public int hashCode() { | ||
return Objects.hash( | ||
Arrays.stream(getClass().getDeclaredFields()) | ||
.map(field -> { | ||
field.setAccessible(true); | ||
try { | ||
return field.get(this); | ||
} catch (IllegalAccessException e) { | ||
e.printStackTrace(); | ||
return null; | ||
} | ||
}).toArray() | ||
); | ||
|
||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
src/test/java/kitchenpos/products/tobe/domain/DisplayedNameTest.java
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
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
1 change: 1 addition & 0 deletions
1
src/test/java/kitchenpos/products/tobe/domain/MenuPriceTest.java
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
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
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
3 changes: 1 addition & 2 deletions
3
src/test/java/kitchenpos/products/tobe/domain/ProductPriceTest.java
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
menu
도메인이 별도의 서버로 분리가 된다면 Value 에 대한 의존성은 어떨까요?