Moving objects...
Dwight Hughes
dwighth at ipa.net
Fri Jul 23 17:09:24 UTC 1999
I find it much more productive to think about methods as adding
*behavior* to an object rather than as ways to push bits of the object
around. Whether a particular method actually modifies the object or not
is immaterial. As you add/refine methods you are adding/refining the
object's behavior. This way you can more clearly separate simply _using_
an object's behavior from _changing_ or _extending_ an object's
behavior.
-- Dwight
Josh Flowers wrote:
>
> That's what I get for not stopping off at the coffee shop before
> work. But, since the cats out of the bag, and I've admitted that I'm
> actually thinking, let me pose a question I've been pondering... Do
> we as programmers put to much "thinking" logic into most of our
> objects? By that I mean are there too many methods that do not
> involve dealing with the state of an object, but are more or less
> algorithms attached to an object. For instance looking at the
> methods of the String class I would have to guess that 2/3 of them
> have nothing to do with accessing, or modifying a string. The string
> method that I brought up a few weeks ago was >>
> lineCorrespondingToIndex. This method simply uses a string, it could
> just as easily be in a library, and take the string to search as
> it's first parameter. By attaching these algorithmic methods to
> objects, do we unduly burden them?
More information about the Squeak-dev
mailing list
|