Discussion Questions for Riel, Chapter 10
The Interrupt Pattern and Interrupt-Polling Pattern
-
Could you give us some "Interrupt Pattern " examples with working codes?
Maybe we want to apply it in our project. (Sheng)
-
How do the examples in the source pattern for the interrupt pattern differ
from the examples of those in the interrupt-polling pattern? (monica)
-
Under 'Target Pattern' on page 187 Riel argues that a contained class
should interrupt an abstract version of its containing class so it is
easier to reuse. However, in the next section Riel argues that the
contained class should interrupt its containing class in order to reduce
dependences. Is there anyway to avoid this trade off? (Jonathan)
-
The rationale for the motivating heuristic of the Interrupt Pattern
(pg.186) says that "if a contained object is dependent of the class that
contains it, then it is not reusable". In the example of ATM, why should
its card reader be reusable for a security door? It makes sense to think
that the card reader should function only for that specific purpose and
that no one should take it out to use it for something else. (Saugar)
Generalization and Specialization
-
Riel says that modelling objects as classes leads to class
proliferation. He suggests that the designer should generalize the objects
into a new class. However the solution is more complicated when the
behavior of each object is different. I dont get how his solution to it
solves the problem of class proliferation? (Gaurav)
-
Can you give an example of the specialization pattern? (David D)
I'm confused about the last Motivating Heuristic in chapter 10. Can you
explain? (Dave V)
-
Why is it on pg. 191 that for the Specialization Pattern we should
eliminate the abstract base class if one of the derived classes inherits
all of its data. Why not get rid of the derived class and keep the base
class as abstract? (Mike C)
-
What is the solution to designers who find themselves in a situation where
they are required to override base class methods in a derived class with a
NOP method? (Gaurav)
-
What's wrong with using NOP methods to override base classes? (Alex)
Inverted Inheritance
-
Could you explain the inverted inheritance pattern better? (Mike L.)
-
Could you give us an example where using the Inverted Inheritance Pattern
is critical? (Dave V)
Heuristics, Patterns, and Their Use
-
Patterns are a widely recognized and used tool in software design.
Heuristics, on the other hand, seem to be basically exclusive to Riel. Are
there any other software design theorists who support Riel-style heuristics
(possibly under another name, such as 'idioms')? (John)
-
Weren't the Heuristics created to eliminate bad patterns in design? Why
does he raise the question "What is the relationship between Heuristics and
patterns"? The chapter seems more like a summary of everything that has
hapened. (David D)
-
In what phase of design should transformation patterns be considered? (Mike
L.)
-
How do programmers detect the flaw in their design and able to apply
recognized patterns into their software early on? How cautious should the
programmer be in following the already exist patterns? When should the
designers start looking for newer solution because of changes in
requirements of the newer software and hardware? (chayapan)
Other Patterns
-
Can you give another example of how to improve the one-instance pattern
that riel talks about on page 194? (monica)
-
In his 'Lexical Scope Pattern' Riel argues that classes inside another
class should not interact between themselves. Wouldn't following this
result in centralized control instead of distributed control? (Jonathan)
-
I don't understand this sentence "If an object outside the lexical scope of
another object can change the second object's state, then the cost of
maintaining the system is increased" Could you explain? (Sheng)
Other Questions
-
Riel mentions the possibility of a software package that would
automatically detect and correct heuristic violating code. Does such
software exist, at this time? (John)
-
How reliable can we expect the automated design and coding systems can be?
How efficient can the automated system help the design process while still
providing the optimal solution to the problem? How programmers can
integrate automated and manual approaches into the production process?
(chayapan)
-
-- A Class should support strict data hiding of its implementation --
Are the design transformation patterns more like documentation of design
flaws rather than something that a designer would use during design phase
of a software development process to correct his work? (Saugar)
-
Why are only two arrows dotted arrows drawn in the target pattern section
on pg. 185 instead of an arrow to each of its three containing objects?
(Mike C)
-
Multiple classes might need the same public variable. Are there cases where
it's okay for a class to not have strict data hiding of its implementation?
(Alex)
This document is available on the World Wide Web as
http://www.cs.grinnell.edu/~walker/courses/223.fa05/readings/riel-10.shtml