bizzare thoughts response to response

West, David M. DMWEST at stthomas.edu
Wed Jun 23 14:38:28 UTC 1999


Peter Smet wrote:

"To put this into an extreme form, in a perfectly factored program, method
xxx will only be
specified in ONE place, in ONE object. Any object that wants to do anything
even vaguely similar to method xxx MUST call method xxx to do it. By
definition, this means it is dependent on the other object providing method
xxx. If it wanted to be independent, then it should implement method xxx
itself, but this would introduce unnecessary and evil code duplication"

There is an alternative - not always desirable - that object philosophy
would suggest.

Reify method XXX as a class in itself and let any object needing to use that
method contain an instance of the XXX class.  You have redundancy at the
object level but not at the class level.  There are only 150 or so elements
but practically innumerable instances of some of thos elements.





More information about the Squeak-dev mailing list