CSC 223 Grinnell College Fall, 2005
 
Software Design
 

Discussion Questions for Riel, Chapters 3-4

God Classes

  1. Heuristic 3.2 says that one needs to be suspicious of classes whose names contain "Driver, Manager, System, or Subsystem". Why is this so? What problems arise from such nomenculature? And what if one was designing an operating system/embedded system, and there needs to be a Driver Manager class? (Dimitar)
  2. In heuristic 3.3 Riel says that we should "beware of classes that have many accessor methods defined in their public interface." However, isn't it impossible to avoid using accessor methods when a class is as simple as a point? (Jonathan)
  3. Can you give an example of when the God Class problem can't be solved? Also an example where the real world can't be modeled because of it? (David D)
  4. The four schemes for checking if students have the necessary prerequisites to get into classes Riel lists on pages 34 and 35 all seem to have some sort of problem: the first two violate Jacobson's heuristics, and the second two reduce student and class to "mindless clumps of data." Riel doesn't provide any other solutions, though. What's an object oriented designer to do when facing such a situation? (John)
  5. Rieler says that the number of classes that should be used should be minimized, and suggests that some classes can be reduced into one. Isn't this moving towards a god like model? (Elijah)

System Design

  1. What is the difference between Heuristic 3.7 and Heuristic 3.8? (Gaurav)
  2. How is the solution to adapting a legacy system described on pages 40-41 not a violation of the earlier heuristics 2.6 and 2.10?
  3. C++ can be compared to OO programming as essentially functioning under the category of a god class (one piece does everything). Is there a language that follows as an ineficient model for OO's "prolifertion of classes" category? (Eric)
  4. When talking about proliferation of classes, Riel describes an ATM with a needless "network" class, but then later a "network wrapper" class is created to separate the ATM objects from an outside data source. Is this a good design technique, or is it part of the proliferation problem? (Lorelei)
  5. Rieler describes agent classes as often being used under the 'guise of reuse', but that using agents is seen as bad seems more like a failing of OOP programming. Wouldn't it be ideal to be able to seperate action from data, IF we could keep track of the relationships between the two? (Elijah)
  6. Rieler talks about minimizing classes and then gives an example of a class that has 30 methods, only some of which are used. He says this is ok. But shouldn't we try to minimize the number and complexity of our methods as well? (Elijah)
  7. How do you decide what is a useless class? (Monica)

Agents

  1. What is the role of an agent class if Heuristic 3.10 indicates that many of them are irrelevant and should be removed? What are the qualities that make an agent essential to a design vs. those that should be removed? (Mike C)

Uses Relationship

  1. In heuristic 4.5 Riel argues that a "narrow and deep containment hierarchy" is better than a "broad and shallow containment hierarchy." Wouldn't following this heuristic lead to the "proliferation of classes" problem? (Jonathan)
  2. What are the disadvantages of violating Heuristic 4.6?
  3. I do not understand the concept of Contained Classes expressed in Heuristic 4.13: "A class must know what it contains, but it should not know who contains it." What does this Heuristic really try to convey? (Dimitar)
  4. Rieler says a class should know what it contains but not what contains it. can this seperation be made by using an agent class? Would Rieler aprove of this? (Elijah)
  5. Could you talk more about Classed-based, Containment, Object-based and Uses relationship together? And please clarify the difference among these relationships. Consistent examples will be appreciated (Sheng).
  6. While it is likely true that narrow and deep containment hierarchies are better than wide and shallow, I don't find Riel's argument on pages 62 and 63 convincing. While it would be troublesome to remember costs for individual food objects, we could easily store the costs in the objects themselves, and then calculating the total would simply amount to adding up the return values of all the individual cost() operations. Only if individual food items have different behavior would it make sense to me to break down the meal class. Not really a question, as much as an observation, I guess. (John)
  7. Riel mentions on pg. 70 that "there are three and not two, relationships invovling uses and containment." How do weak containment and strong containment affect a model's implementation? Is it possible to have something that isn't really strong or weak? (Mike C)
  8. Why do we have to distinguish attribute class and contained class? How do we deal with the class that need to have both properties (not necessary a god class)? (Chayapan)

General Issues

  1. Can you relate the Heuritics of Chapter 3 and 4 to various UML diagrams? (David)
  2. What are the pitfalls to binding particular objects and classes to one domain? (Eric)
  3. What's the significant difference between Action-Oriented and Object-Oriented (Sheng).
  4. When do you use containment, when do you use inheritance? (Monica)
  5. What is the difference between "object-based versus class-based"? (Chayapan)


This document is available on the World Wide Web as

http://www.cs.grinnell.edu/~walker/courses/223.sp05/readings/riel-3-4.shtml

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