Skip to content
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

어댑터와 서비스가 1대1 대응이라면 포트를 만들 필요가 있을까? #11

Open
woosung1223 opened this issue May 15, 2023 · 1 comment
Assignees

Comments

@woosung1223
Copy link
Collaborator

woosung1223 commented May 15, 2023

어댑터, 서비스가 하나뿐이라면, ISP를 굳이 적용해야 할 필요가 있을까?
만약 한다면 어떤 이점이 있을까?

@woosung1223 woosung1223 self-assigned this May 15, 2023
@woosung1223 woosung1223 changed the title 어댑터와 유스케이스가 1대1 대응이라면 포트를 만들 필요가 있을까? 어댑터와 서비스가 1대1 대응이라면 포트를 만들 필요가 있을까? May 15, 2023
@woosung1223
Copy link
Collaborator Author

woosung1223 commented May 15, 2023

비버:
1대1 대응인데 나중에 기능이 두 개 생길 수도 있고, 확장성을 고려해서 그런 것이라고 생각한다.
애쉬:
쓰면 된다! 지금 당장은 필요없지만 유스케이스는 언제든 추가될 수 있고 비버와 마찬가지로 확장성을 고려한 것이라고 생각한다. 그리고 일관성의 측면에서도 쓰는게 맞는 것 같다.
누누:
1대1로 대응이 확실하다면 큰 상관은 없을 것 같은데, 포트를 만들었을 때 장점을 생각해보아야 한다. 컨트롤러를 POJO를 통해 단위테스트가 가능해짐. Mockito를 안쓰고 실제로 Mock 객체를 사용해서 정해둘 수 있다.
비버, 애쉬:
Mockito를 안쓰고 Mock 객체를 직접 만들어 사용하는 이유는?
누누:
Mockito를 사용해버리면 의존성이 너무 복잡하게 되어서 잘못된 코드를 만들 확률이 높아진다. (이동욱님 글 참고 https://jojoldu.tistory.com/320) 너무 쉽게 테스트를 짜게 되니 좋은 프로덕션 코드를 찾기가 어려워진다. 즉, 포트를 만들어라! 서비스는 쪼개든 합치든 상관 없이.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant