Skip to content
Discussion options

You must be logged in to vote

객체지향의 사실과 오해 내용까지 참고하는 모습 보기 좋습니다 👍
해당 아이템 내용은 객체지향 프로그래밍에서 근간이 되는 특징 중 하나로 봅니다.

public 필드 지양은 당연한 얘기고, 접근자 메서드 사용에 대해서 저는 다음 3단계로 생각이 확장되는 것 같네요.

  1. 접근 지정자 사용을 지향한다.
  2. setter 를 지양한다.
  3. 무조건 getter 사용도 지양한다.

2번과 3번에 대해 읽을거리가 있으니 한번 읽어보는 것을 추천합니다.

  1. Setter를 지양해야 하는 이유
  2. getter를 사용하는 대신 객체에 메시지를 보내자

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@Irisation23
Comment options

Irisation23 Jan 2, 2023
Maintainer Author

@JoisFe
Comment options

Answer selected by Irisation23
Comment options

You must be logged in to vote
1 reply
@Irisation23
Comment options

Irisation23 Jan 2, 2023
Maintainer Author

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4장 클래스와 인터페이스 이펙티브 자바 4장 (클래스와 인터페이스)
5 participants