Computer Science 223 Discussion Questions

Riel, Chapter 3

Discussion Questions submitted for Chapter 3 of Riel.

God Classes

  1. What exactly is a god class? What are the characteristics of a god class? --Hisako
  2. Does Object-Oriented Program with a god class still maintain an advantage over an action-oriented program performing the same function? Patrick Dowd
  3. I'm having a bit of a hard time understanding exactly why the God class is always bad. Could you give some examples of how and why it causes problems?
  4. How do you know when you have a good balance between god-like classes and a proliferation of classes? -Jim Finnessy
  5. Is it acceptable to have god classes or a proliferation of classes if they model the real world? -Jim
  6. When writing a program (in particular when migrating a system) one can easily create a god class. The resolution of this problem is to devide up different parts. But then you face the proliferation of classes problem. Are there steps with which one might go about deviding up the god class without remaining too much of a god class but at the same time also not falling into the proliferation of classes problem? -Jonathan Kensler
  7. Could controller classes be clarified? I understand the VCR example, but I don't see how to apply it to OOP.
  8. The book seems to advocate a balance between god-classes and proliferation of classes, but how is that balance maintained if a project keeps expanding? Should classes perhaps be consolidated when too many begin to exist? -Todd
  9. How often does avoidance of proliferation of classes end up creating a new problem of a god class? Patrick Dowd
  10. What is the difference between a controller class and an interface in java? George Yeboah
  11. Heuristic 3.2 states that we should be suspicious of classes whose names contain Driver, Manager, System, Subsystem. What are these and how are they different? Elias Vafiadis

Agent Classes

  1. Can you clarify the role of agent classes?
  2. Could you please expland on the definition of Agent classes? -Todd
  3. Why have agent classes when they will eventually be removed? Elias Vafiadis
  4. When is it good and not good to use agent classes? (Sam Vanderhyden)
  5. In preliminary design should we include Agent classes even it we think that there is a good chance that it would be irrelevant? Steve F
  6. Is the Librarian irrelevant after all? If so, how come the PrereqChecker was not irrelevant in the course-scheduling system domain? Desi Dimova
  7. Riel says that Jacobson recommends the use of decouplers such as the librarian class, but Riel does not like them. It seems like they would slow down performance, but is s there a time when they are necessary? -Peter Likarish
  8. In figures 3.11 and 3.12, what is actually different in the appearance of the code. Is CallProcessingBlock no longer a class? Steve F

Proliferation of Classes

  1. The chapter mentions several ways to cut down on the number of classes, eliminating agents, irrelevant classes, and those outside of the system. At the same time it states that "god" classes should be avoided. What, other than common sense, can be used to determine the necessity of a class? josh vickery
  2. How is the problem of proliferation of classes handled in java? George Yeboah

Accessor Methods

  1. What are accessor methods and how may they be dangerous? Taha
  2. Why do too many accessor methods cause a behavioral problem? --Hisako
  3. An example for Heuristic 3.3 would be nice. (Raz Magar)
  4. How much should accessor procedures such as get() and set() be treated as warning signs for improper incapsulation of data and procedures? How often are these kind of accessor procedures used in well-designed code? (-Nick)
  5. How does having many accesor methods in classes defined in their public interface imply that the related data and behavior are not being kept in one place?

Other Questions

  1. The author discusses his heuristics in terms of his personal opinions, in contrast to several other models and examples. Do you agree with the decisions the author choses to make in all these cases? If so, why do you feel his view is superior? If not, which ones do you feel differently about and why?
  2. In the object-oriented farm example, should there be a milkman or not? Desi Dimova
  3. Is there a good formula for migrating from action based to object oriented other than examining the given code extensively?
  4. Are there any specific ways of going about trying to model the real world? -Jonathan Kensler
  5. What is a "wrapper class" and how is it used? Taha
  6. Is a class outside of the system automatically an irrelevant class? Or is it possible that it is needed, just poorly done? -Peter Likarish
  7. What steps would we take if we were to convert an action-oriented model to an object-oriented one? ~yasir.
  8. Is Riel suggesting in this chapter that the action-oriented paradigm would never be preferable over the object-oriented paradigm? --Khong
  9. Riel suggests keeping data and behavior in one place. Isn't this tantamount to taking an action-oriented approach? Anthony
  10. The section "When the action-oriented paradigm goes right" implies that object oriented design or coding results in a better project when programmers or designers are not trully excellent, since it enforces the paradigm. What if something is better expressed in an action-oriented manner, Java and C++ allow for programmers to step out of the object oriented framework to address the problem in an imperitive manner, is this, from the authors view, bad? josh vickery
  11. In what ways is inheritance and derived classes differently?
  12. Is object-oriented programming less intuitive than action-oriented paradigms? (i.e., is it harder to learn object-oriented languages as opposed to function- or data-driven languages?) (-Nick)
  13. Riel's playful/tongue-in-cheek language in his explanations or illustrations of the object/classes/accessor issues in the chapter often obscures the ideas presented. Can we outline the basic concepts behind poor object-oriented design? --Khong
  14. When does heuristic 3.6(Model the real world whenever possible) become more important than the other heurestics in conflict? Anthony
  15. I am not sure if I understand the example given for Heuristic 3.5. Could you explain it in class or give us a different example which is easier to follow. (Raz Magar)
  16. Is it always a good idea to package data and functionality even if it doesn't model the real world (such as the vcr example), or are there situations when it is better to model a solution after the real world? (Sam Vanderhyden)

This document is available on the World Wide Web as

created February 7, 2002
last revised February 8, 2002
Valid HTML 3.2!
For more information, please contact Henry M. Walker at