"Is-a, has-a"의 두 판 사이의 차이

26번째 줄: 26번째 줄:
*[[상속]]
*[[상속]]
*[[소프트웨어 공학]]
*[[소프트웨어 공학]]
*[[객체 aggregation, composition]]


==참고 자료==
==참고 자료==

2013년 8월 15일 (목) 20:13 판

is-a, is_a, is a
상속관계
has-a, has_a, has a
소유관계

1 is-a

  • 상속 관계
  • A is-a B
A는 B를 상속함
A는 B의 서브클래스
  • 예시
Apple is a fruit.→ 사과는 과일이다.
Apple은 Fruit의 속성을 모두 상속받음

2 has-a

  • 소유 관계
Aggregation 또는 Composition 관계
  • A has-a B
A가 B를 가지고 있음
  • 예시
Car has a Wheel
Pond has-a Duck

3 같이 보기

4 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}