Riel, Sections 5.7-5.13
Discussion Questions submitted for Sections 5.7-5.13 of Riel
Polymorphism
-
Is there a clearer way of explaining polymorphism?
-
Could you explain polymorphism in more detail and explain what would be a
good example of polymorphism. Taha
-
I understand the example of polymorphism on page 96, but I am still
confused, why it is so useful in Object-Oriented programming. Could you
explain, how having a hash table or pointers is an effective way of O-O
programming? --Hisako
-
To what degree should we try to limit the complexity of inheritance
heirarchies?
-
Could you clarify the difference between true polymorphism and just plain
polymorphism? (Sam Vanderhyden)
-
I could not quite understand the difference between true polymorphism and
polymorphism. (Raz Magar)
-
What are the main distinctions between polymorphism, true polymorphism, and
pure polymorphism? --Khong
-
What type of polymorphis do our appointment classes use? Do we follow the
heuristics? (Nick W)
Base Classes and Abstract Classes
-
Why should all base classes be abstract classes?
-
why should the commonality of data/behavior be factored as high as possible
in the inheritence hierarchy?
-
Could you clarify the distinction between heuristic 5.10 and 5.11? George
-
I don't understand the explanation of Heuristic 5.11. Could we go over it
during class?
-
Could you explain heuristic 5.11 in more detail that is, if two or more
classes share only a common interface, then they should inherit from a
common base class only if they will be used polymorhically. Taha
-
If a method of a base class is going to be overwritten by all of its
derived classes, what is the reason for even having that message in the
base class? Steve F.
-
In the scheduler implementation, should all base classes be abstract? Would
that be a better design? -- Elias Vafiadis
-
Can we make AvailableAppt an abstract class? That would violate heuristic
5.6. It seems to me that AvailableAppt makes sense as an abstract class, so
is the heuristic invalid in this case? -Peter Likarish
-
When is it best to use a abstact class, and when is it more appropriate to
use a public interface? What are the advantages and disadvantages of each?
-Jim Finnessy
Case Analysis
-
It seems that the inheritanc hierarchy in Figure 5.15 can be obtained by
starting with the base class 'Fruit' as well. What determines the
preference over generalization to specialization versus the other way
around? (Raz Magar)
-
It seems like Heuristic 5.13 (Case analysis on the value of an attribute is
often an error. Instead make and inheritance hierarchy) can lead to class
proliferation. Why is this ok? (Sam Vanderhyden)
-
Riel says explicit case analysis is usually wrong (5.12), when can it be
correct? Patrick Dowd
-
Could heuristic 5.14 be broadened to say that modeling of dynamic semantics
of a class should rarely be handled with states as subclasses? -Todd
-
It is not clear to me, if the heuristic 5.13 should be followed, that how
abstract/concrete the case analysis should be at the beginning stage of O-O
programming? How do we identify them? --Hisako
Dynamic Semantics
-
With regard to appointments. Do we run the risk of violating heuristic 5.14
by having such diversified appointments in our schedule? It seems like they
might be switching appointment types frequently. -Peter Likarish
-
In what case might we run into this problem of modeling dynamic semantics
with an inheritance relationship? Steve F.
-
What advantages have abstract classes over interfaces? -Anthony Fynn
Other Questions
-
What is the difference between interrupt-driven and polling systems? The
definition on p103 is somewhat vague. Desi Dimova
-
To what extent does generalization add to complexity and to flexibility?
~yasir.
-
Riel says he does not like the method of examining an English description
of the system. He then goes on to endorse essentially the same policy, how
is class proliferation be avoided? Patrick Dowd
-
Does Java use jump tables? -Todd
-
Does proper object oriented design result in better software? When the goal
is a working piece of software how much time can one justify spending on
worrying about how well they are following the object oriented paradigm?
josh vickery
-
What is the difference between "messages" and "methods"? -George
-
Are all messages in the form of methods? -Anthony Fynn
-
What is runtime type discrimination? -Jim Finnessy
-
Why can a polling solution be more inefficient? Desi Dimova
-
Could you give some measure of reusability, showing how much people are
generally able to get, compared with the optimal?
-
How do we maintain optimal code reusability? --Khong
-
What is the difference in implementation between inheritance and an
object's dynamic semantics? ~yasir.
-
Could you carify "polymorphic hooks"?
-
On p. 102, is Riel suggesting that "hooks" in base classes designed to
increase reusability in derived classes are *always* considered
implementation details? What exactly does this mean? (Nick W)
-
Imagine that we had a signifigant chunk of code, wrapped up in a class. If
we wanted to extend the functionality of that class, but one one method was
unacceptable, would it be better to cut and paste all of the code into a
new class that did not contain that one method, or to extend that class,
NOPing the one undesirable method? josh vickery
This document is available on the World Wide Web as
http://www.cs.grinnell.edu/~walker/courses/223.sp02/read-riel-5b.html