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

IS-A 관계와 HAS-A 관계의 차이점 #59

Open
anthologia opened this issue Jan 4, 2023 · 0 comments
Open

IS-A 관계와 HAS-A 관계의 차이점 #59

anthologia opened this issue Jan 4, 2023 · 0 comments

Comments

@anthologia
Copy link
Collaborator

이펙티브 자바 3판의 [ITEM 18 - 상속보다는 컴포지션을 사용하라] 을 통해 무분별한 클래스 상속이 해악을 일으킨다는 사실을 알게 되었습니다.

그리고 이를 막기 위해서는 올바른 상속 / 컴포지션 관계를 구성해야 한다고 합니다.

상속은 두 클래스가 순수한 IS-A 관계일 때만 써야 한다고 하는데요.

IS-A 관계와 HAS-A 관계는 무엇인지, 그리고 둘은 무슨 차이를 갖는지 알아보아요.

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