Reading: Practical object-oriented design in ruby (ch. 7)
This work is due by 8:00pm on Thursday, 3 May 2018.
Read Chapter 7 of Practical Object-Oriented Design in Ruby.
For the journal send an email message to me titled “CSC 322.01 2018S Journal on Practical object-oriented design in ruby (ch. 7) (Your Name)” (without the quotation marks) and with answers to the following questions.
-
From your perspective, how are mixins (modules in Ruby) similar to and different from inheritance (and, implicitly, superclasses)?
-
One of the disadvantages of multiple inheritance is that it is not easy to determine which superclass to delegate to when two superclasses implement the same method. How do mixins help resolve this problem?
-
Explain the difference between outputs on lines 24 and 30 of p. 153.
-
Metz begins this chapter by suggesting that classical inheritance would not make it easy to create a recumbant mountain bike. Describe how you would set up a program that supports Bicycles, Mountain Bikes, Recumbant Bikes, and RMBs.
-
What do you consider the most important takeaways from this chapter?