Replies: 2 comments
-
getter() 대신에 객체의 상태를 변경하는 메서드를 제공하고, 필요한 경우 객체의 상태를 읽을 수 있는 메서드를 명확하게 정의하는 것이 좋습니다. |
Beta Was this translation helpful? Give feedback.
0 replies
-
getter 메서드를 사용하게 되면 캡슐화가 깨지게 됩니다. 객체의 내부 상태를 외부에서 직접 접근할 수 있게 하는 것이기 때문입니다. 또한 객체의 내부 구현에 대한 의존성이 높아지게 됩니다. (추가로 볼 것) 디미터의 법칙 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
글쎄요 멀까요?
Beta Was this translation helpful? Give feedback.
All reactions