CSC 223 Grinnell College Fall, 2005
 
Software Design
 

Discussion Questions for Riel, Chapter 6

Definitions from Riel, p. 141:

Multiple Inheritance

  1. Is containment the only way to model multiple inheritance when it's not available, or are there other possible approaches? (Lorelei)
  2. What are the usual performance penalties for using multiple inheritance? (John)
  3. Java doesn't include multiple inheritance, so how would a developer model one of the legitimate uses of multiple inheritance without introducing accidental complexity such as the wooden door example? (Mike L.)
  4. Are there any examples where legal multiple inheritance exits but the questions on page 135 aren't answered properly? (David D)
  5. I didn't very clearly understand Heuristic 6.3. What is the disadvantage of having a base class be actually a derived class of another base class, in reference to Multiple Inheritance? (Gaurav)
  6. Are Riel's yes/no questions alone always sufficient tests to see if multiple inheritance is needed? (monica)

Mixins

  1. Why does Riel recommend using conditional testing for compositional mixins? ( page 138). Isn't conditional testing bad? (Elijah)
  2. What are some situations for programs that would work better with compositional mixins vs. traditional mixins or vice versa? (Mike C)
  3. Is the creation of a 'mixin' likely to lead to undue complexity? (Eric)
  4. Could you explain mixins more thoroughly? (Mike L.)
  5. Why is containment the best way to make mixins more flexible? Can you use multiple inheritence and simply override the original function to check for the conditional? (Lorelei)

Delegation Functions

  1. What are delegation functions? (Sheng)
  2. How do delegation functions work and are they only used in situations where containment is necessary? (Mike C)

Other Questions

  1. In chapter 6 Riel describes which heuristics should be satisfied in order to use multiple inheritance, but he doesnt explicitly state the advantage of using MI, infact he seems more against it. What are the advantages of using MI ? (Gaurav)
  2. In section 6.8 Riel suggests 'containment by reference' for the house case. Why can?t the same solution apply to the grad student case in section 6.7 which uses 'DAG multiple inheritance'? (Chayapan)
  3. can you explain the example in section 6.5 about frameworks that incorporate multiple inheritance? (monica)
  4. Are there often hard limits to the number of classes that you can use in multiple inheritance? Does this every present a problem in practice? (John)
  5. What is "virtual" inheritance called in Java? (David D)
  6. The house example in section 6.8 shows that optional containment can cause accidental DAG multiple inheritance, but his suggested solution back in section 5.18 does not show how to integrate the optional component. Following the house example, how does the optional component (heating, cooling, etc.) be separately implemented and then integrate into the diagram? (Chayapan)
  7. What is pseudo-inheritance? Is it a bad design? (Sheng)
  8. on page 140, Riel says that "we cannot always eliminate one copy of base class data". But suppose we wanted to elimate one copy of the case class data (so that the graduate student wouldn't have two SSNs). How would we do this? Also, how are objects 'viewed' from the point of view of Instructor or of Student? (Elijah)
  9. Is there an instance where a 'white-box' design would be a good thing? (Eric)


This document is available on the World Wide Web as

http://www.cs.grinnell.edu/~walker/courses/223.fa05/readings/riel-6.shtml

created 30 October 2005
last revised 31 October 2005
Valid HTML 4.01! Valid CSS!
For more information, please contact Henry M. Walker at walker@cs.grinnell.edu.