-
Notifications
You must be signed in to change notification settings - Fork 241
3단계 - 의존성 리팩터링 #530
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
3단계 - 의존성 리팩터링 #530
Conversation
… 제거 및 orderTableId를 통한 간접 참조로 로직 변경
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.
안녕하세요 시현님 :)
3단계 바로 머지해도 될 정도로 잘 해주셨네요 :)
한 가지 코멘트 드렸으니 고민해 보신 후 다음 단계에 함께 반영 해 주셔도 좋을 것 같습니다.
그럼 이만 머지하겠습니다!
|
|
||
| ### 의존도 draw | ||
| - Before(https://github.com/tyakamyz/jwp-refactoring/blob/step3/docs/refactor-before.drawio.png) | ||
| - After(https://github.com/tyakamyz/jwp-refactoring/blob/step3/docs/refactor-after.drawio.png) |
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.
의존성은 변하기 쉬운 것이 변하지 않는 것을 의존하는 방향으로 흘러가는 편이 안정적입니다.
(presentation -> service -> domain 방향으로 의존하는 것 처럼 말이죠 :))
이를 각 도메인 간의 관계에도 적용 해 볼 수 있을 것 같은데요
table에 비해 order는 쉽게 변할 수 있는 변경이 잦은 도메인으로 보입니다.
헌데 지금은 table이 order에 의존하고 있네요
인터페이스를 이용해서 의존성을 역전해보시면 어떨까요?
인터페이스는 table 도메인에 두고, 구현체를 order 쪽이 가져간다면, 의존성이 역전 될 수 있을 것 같아요 :)
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.
조언 감사드립니다!
말씀해주신 내용 적용해보겠습니다 :)
안녕하세요 리뷰어님
3단계 - 의존성 리팩터링 PR 드립니다 :)
의존도를 머릿속 계산만으로는 그려지지가 않아서... 그림을 그리고 시작했습니다
리팩토링하면서도 그림을 업데이트 해가며 작업했습니다
그럼 이번 리뷰도 잘 부탁드리겠습니다!
Before
After