Title: Multiple Inheritance Section 10'5
1Multiple Inheritance(Section 10.5)
- CSCI 431 Programming Languages
- Fall 2003
A compilation of material developed by Felix
Hernandez-Campos and Mircea Nicolescu
2Multiple Inheritance
3Multiple Inheritance - Implementation
4Multiple Inheritance - Implementation
5Multiple Inheritance - Implementation
6Multiple Inheritance - Implementation
7Multiple Inheritance
8Multiple Inheritance
9Multiple Inheritance
10Multiple Inheritance
gp_list_node person gp-list_node
\ / \ /
student professor \
/ student_prof
- Repeated inheritance multiple inheritance where
there are multiple paths to an ancestor - Types of repeated inheritance
- replicated inheritance separate copies
(gp_list_node) - shared inheritance single copy (person)
- Eiffel by default shared inheritance
- can get replicated inheritance of individual
members by renaming them
- C by default replicated inheritance
- can get shared inheritance by labeling the
inheritance as virtual
class professor public virtual person, public
gp_list_node ... class student public
virtual person, public gp_list_node ...
11Replicated Inheritance
12Shared Inheritance
13Object-Oriented Languages
14Object-Oriented Languages