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

12장 창발성 #28

Closed
su-pernova opened this issue May 15, 2023 · 1 comment
Closed

12장 창발성 #28

su-pernova opened this issue May 15, 2023 · 1 comment
Assignees

Comments

@su-pernova
Copy link
Member

창발성이 무엇인가? 어떤 방법들이 있는가? 어떻게 실천해야 할까?

@ynoolee
Copy link
Contributor

ynoolee commented May 17, 2023

하나의 클래스 내에서 여러 메서드에 중복되는 공통 구현 로직을 추출은 많이 하게 됩니다. 그런데 저는 보통 이를 그냥 private 메서드로 둔 경우가 많았는데, 책에서는 이 private 메서드를 추출하였을 때 SRP 를 위반하게 할 경우 다른 클래스로 분리하는 방법을 소개하고 있었습니다.
생각해보니 validator 라는 이름을 가진 클래스를 작성하게 되었던 부분이 이와 유사한 거 같네요.

이렇게 공통 구현 로직을 다른 클래스로 빼낼 때의 장점에 대해 그저 '재사용성' 이라고만 생각했었는데요. 책에서 "가시성을 높인다" 라는 말이 인상깊었습니다. 다른 클래스로 빼내었다는 것은 아마 public 하게 제공하는 기능으로 열어두었을 것이고, 이로인해 다른 팀원들은 해당 클래스의 public 메서드를 보고, 재사용 해야겠다는 생각을 쉽게 할 수 있어질 것 같습니다.

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

4 participants