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

ch 10 클래스 #21

Closed
ynoolee opened this issue Apr 29, 2023 · 2 comments
Closed

ch 10 클래스 #21

ynoolee opened this issue Apr 29, 2023 · 2 comments
Assignees

Comments

@ynoolee
Copy link
Contributor

ynoolee commented Apr 29, 2023

책을 읽으며 궁금 했거나 공유하고 싶은 내용에 대해 자유롭게 말해주세요~

@ynoolee ynoolee changed the title ch 10 : 클래스 ch 10 클래스 Apr 29, 2023
@ynoolee
Copy link
Contributor Author

ynoolee commented Apr 29, 2023

  • 함수 챕터 를 읽을 때, 위에서 아래로 읽게 하라는 말이 단순히 public -> private 순으로 메서드들을 위치 시키라는 말인 줄 알았슴다; 그런데 관련된 기능을 가깝게 위치시키는게 더 중요한 거였다는 것을 알게되었슴다..
  • 최근에 리팩토링을 진행하면서 크기가 큰 함수를 작은 함수로 쪼개며 해당 함수에 있던 지역변수들이 모두 분리된 작은 함수의 인자로 전달되는 경험을 한 적이 있는데, 이런 경우 객체로 쪼개는 것에 대해 고민해 봐야겠다고 생각했습니다
  • 리팩토링을 위해 테스트 코드를 작성하는 것이 정말 중요한 것 같습니다. 특히 구조같은 것을 변경할 때, '기능' 자체는 이전처럼 동작하는지를 테스트 하는 큰 단위의 테스트라도 하나 있는게 필요한 것 같습니다.

@YHLEE9753
Copy link
Contributor

전체적으로 유용한 내용이었습니다.

  • Sql 클래스를 통해 리팩터링을 진행하면서 SRP 와 OCP 의 좋은 사례를 볼 수 있어 좋았습니다.
  • 응집도가 높아지도록 변수와 메서드를 적절히 분리해 새로운 클래스로 쪼갠다도 인상깊었습니다
  • private 메서드는 개선사항을 내재한다 이유는 변경지점이 많아질수 있고 그로 인해 OCP 가 위반될수도 있다. 이렇게 이해했습니다

@ynoolee ynoolee closed this as completed May 7, 2023
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

3 participants