Riel, Chapter 4
Discussion Questions submitted for Chapter 4 of Riel
Container Classes
-
Are container classes completely contained by the containing classes? That
is, can you only get to an object in a container class through on object of
the containing class? Steven F
-
It seems to me that the idea of a containment class is very similar to an
agent class. What is a containment class other than an agent class with the
capability of taking one request and fanning it out to the classes that it
contains? josh vickery
-
Are containing classes more than just a way to organize objects in a better
way as shown in the meal classes? Steven F
-
Is containment by reference really a containment relationship or a
different type of relationship all together? -Jim Finnessy
-
Could we see containment applied to our ongoing scheduler example? todd
-
Can you discuss more about containment by values and containment by
reference? -Jonathan Kensler
-
The book implies that the relationship between a car and an engine is one
of strong containment whereas that between a student and a classroom is of
weak containment. What if there was a single student in the classroom?
Would that make a strong containment relationship between a student and a
classroom? ~yasir.
-
Containment by value vs containment by reference: which one is better to
use? Does Java support this distinction? Elias Vafiadis
-
Could you please explain Heuristic 4.10? What does it mean by "as far down
a containment hierarchy as the domain allows"? --Hisako
-
I have a hard time seeing the dividing line between "containment"
relationships and the fourth type of "uses" relationship in which an object
gets built and then destroyed. What are examples of these two types of
relationships? (-Nick)
-
What is the most effective design strategy in dealing with the third type
of relationship involving uses and containment (where we must consider
strong or weak forms of containment)? --Khong
-
what are examples of distributing system intelligence "vertically down
narrow and deep containment hierarchies?" taha
-
Please explain the difference between broad and shallow classes and narrow
and deep classes? Anthony
-
Could you further explain heuristic 4.8? todd
Uses Relationships
-
Is there any possible reason to have two items within the same containing
class have a uses relationship between them? Patrick Dowd
-
Which type of uses relationship is appropriate for different situations?
-
How would we implemented the uses relationship in the classes for our
project that we discussed in class so far? ~yasir.
-
What does Riel exactly mean by Heuristic 4.2- minimize the number of
message sent between a class and its collaborator? George Yeboah
-
How does Heuristic 4.2 relate to to the danger posed by having too many
accessor methods? George Yeboah
-
What is the author trying to demonstrate about the complexity of
collaborating in figure 4.9 and the relevant descriptions? -Jim Finnessy
-
why does complexity come only at a class level and not an object level in a
uses relationship? taha
Constraints
-
What is the difference between implementing a constraint in a constructor
and capturing constraint in a constructor? Anthony
-
What is the distinction between centralizing the info for semantic
constraints and decentralizing it? -Peter
-
Can you give actual programming examples semantic constraints? -Jonathan
Kensler
Fanout
-
Why should we minimize fanout in a class?
-
How accurate is it to measure the complexity of a system by counting the
amount of fanout? Elias Vafiadis
Other Questions
-
What does the author mean by "users of data structures never access data
directions"? (on p.62) Who are "users"? Other programmers, who wants to use
the method somewhere else? --Hisako
-
What are inline functions? And how do they eliminate the efficiency problem
perceived with the narrow and deep hierarchies? Desi Dimova
-
The idea of depth in classes while distributing intelligence horizontally
seems at odds with itself, how is this reconciled?
-
After reading Riel's examples I'm still not sure: When is it okay to
violate heuristic 4.14? -Peter
-
When one minimizes the number of classes which another class collaborates
by creating a new class, doesn't that just create the new problem of
proliferation of classes? Patrick Dowd
-
How do we determine the extent to which the number of message sends between
a class and its collaborator must be minimized, given that complexity is
constant? Riel does not seem to give a concise explanation. --Khong
-
What is a wrapper class? Is the containing class an instance of a wrapping,
or is wrapping an instance of containment? Or is a containing class the
same as a wrapping class? Desi Dimova
-
How exactly are we supposed to avoid class proliferation if there is a hard
limit on the number of objects per class? When is which heuristic more
important?
-
By further packaging classes into classes into classes the code does become
more reusable, but is it always worth the added layers of complexity?
-
Page 57 seems to suggest that having god-like classes is okay as long as
they're not employed in a high level of design. Is this truly the case?
(-Nick)
-
The author mentions case tools at the very end of the chapter. Could we
talk about case tools, I'm not familiar with the concept. josh vickery
-
what is the effect on the complexity of a system if a class has many message
sends to a collaborating class instead of just one?
-
Should attributes necessarily encapsulate some data entities? How similar
or different are they from the fields of an object? (Raz Magar)
-
Is creating illegal objects like throwing Exceptions? (Raz magar)
This document is available on the World Wide Web as
http://www.cs.grinnell.edu/~walker/courses/223.sp02/read-riel-4.html