Riel, Sections 5.14-5.20
Discussion Questions submitted for Sections 5.14-5.20 of Riel
Overriding a Base-Class Method with NOP
-
Heuristic 5.17: Wouldn't it be more efficient to just NOP a base class
method instead of copying all the methods but one to the derived class? -
Elias Vafiadis
-
Can you go into more detail about the NOP procedure? Patrick Dowd
-
How do you solve the problem a, should be, derived class has already
been implemented, but its base class needs to be added, if it is poor to
make it a derived class with a NOP? Steve F
-
Is it ok for a base class method to be changed to NOP method by the
base class. There are two problems with it described in the textbook but
what are the good things about the "fat-interface" solution, besides being
easy for implementation? Dessislava Dimova
-
The author goes to great legth to prove the logic behind heuristic
5.17. While this heuristic makes sense, is it not perhaps often more work
than it is worth? -todd
-
If one flips the hierarchy for not to have NOP, does it jeopardize the
structure of the entire hierarchy? --Hisako
Optional Parts of Objects
-
Can you talk further about optional containment, perhaps with respect
to the project? -Todd
-
Could you clarify containment by reference?
-
How does containment by reference lead to a better solution for the
optional component problem? (Sam Vanderhyden)
-
Regarding heuristic 5.18, can you futher explain how to use
containment by reference as a solution to optional components? Anthony
-
Can you give us a better sense of how to detect when something there
exists 'optional containment' and when we need inheritance? - Jonathan Kensler
-
Could you discuss the advantages and disadvantages of containment by
reference versus inheritance. Taha
-
In section 5.18, it says adding an optional component doubles the
number of derived classes. Is that because derived classes also have option
to use or not use those components, which translates to 2^n possible
combination of derived classes for n optional components added to the base
class? In the same section referencing is mentioned as an alternative to
inheritence, but does Java allow referencing? (Raz)
Frameworks
-
Can you go over frameworks more? - Jonathan Kensler
-
When exactly would we prefer to reuse components over frameworks and
vice versa? ~yasir.
-
What's the difference between a framework and a component? - Elias
Vafiadis
-
With regard to heuristic 5.19, how do you create a reusable framework
rather than a component? -Peter Likarish
-
What exactly is the difference between a framework and a component?
(Sam Vanderhyden)
Inheritance and Derived Classes
-
Could you please clarify the difference between a type of the class
and a derived class. ~yasir.
-
What is a good way of identifying derived classes? Taha
-
In the case where a class contains and inherits from the same class,
what happens to the heuristic that a class should not know about its
container? Isn't it violated? Should that matter though? (Raz)
-
While Riel says to be suspicious of derived classes with one instance,
when would this be a good idea? Patrick Dowd
-
Please explain how adding symbols to the house example led to as much
class proliferation as Riel described, I didn't get it. -Peter Likarish
-
Are there any cases of the types of polymorphism in, for example, our
present project? Anthony
-
Could you explain 5.15 better for me? George
-
Heuristic 5.15 discourages to make derived classes. Then, when can we make
them? It seems that it is a very thin line, whether to have derived classes
or not. --Hisako
-
What is the relation between 5.15 and 5.16? George
Problem Solving Perspectives
-
How could we be sure that a problem is not without an optimal solution. In
section 5.19, the author suggests that if there is no optimal solution to a
problem we have to select one with a major drawback. But if we find a
solution with a major drawback, and we are not sure that there must be
another better solution, shouldn't we just go with the not so good
solution? Dessislava Dimova
-
It seems like one must spend a good deal of the design process defining the
problem in terms of the object oriented paradigm in order to use it. (see
section 5.19). If a problem seems to lend itself more readily to a
different design paradigm, is it worth the time to work it into an
object-oriented problem? josh vickery
Other Questions
-
Can we have an IQ check in classes other than dog? I think that might
be useful.
-
Can you better define dynamic semantic wrapper? -Jim Finnessy
-
Could you provide some examples about building a class or objects at
runtime? Steve F.
-
What would be an example of a time where someone would think that they
needed to create classes upon start up, which led to the creation of
heuristic 5.16? -Jim Finnessy
-
How does section 5.14 explain how to use inheritance to hide the
representation of a class? josh vickery
This document is available on the World Wide Web as
http://www.cs.grinnell.edu/~walker/courses/223.sp02/read-riel-5c.html