Squeak programming question

Gaston Dombiak dombiak_gaston at jpmorgan.com
Tue Mar 23 18:31:00 UTC 1999


I think that in order to create a new class it needs to have an esence. And
from its esence we will derive its responsibilities.
I don't have enough information about the original problem but maybe
instead of creating a new class (maybe as a programming resourse) the root
of the problem layies in the contracts of the class (the one with the
original problem).

  -- Gato

PS: About the esence of an object and the derived responsibilites we
presented the last year a paper at ECOOP. More info can be obtained at
their home page.





Carl at appliedthought.com on 03/23/99 02:54:46 PM

Please respond to squeak at cs.uiuc.edu

To:   kpgrant at mindspring.com
cc:   squeak at cs.uiuc.edu (bcc: Gaston Dombiak)
Subject:  Re: Squeak programming question





>Quick programming question from a Squeak/Smalltalk newbie:
>Is there any elegant method for handling occasions when you
>wish a method to return multiple objects?  I'm writing a
>method that will return a set and a dictionary to the
>caller.  I can't reasonably break up the method into two
>methods (one for each kind of data), and the contents of
>the set and dictionary are unrelated enough that it seems
>silly to make a whole new class of object containing nothing
>but pointers to each.

Many people have already answered this question with ways to do it.  But
given that you are a newbie, I'd like to urge you to consider closely the
replies of Markus, Andres, Allen Wirfs-Brock, and others.  Like them I've
noticed that almost all the time I hear this question from a newbie, they
are missing a valuable opportunity for a new object that is a valuable
abstraction (you will thank yourself latter).  So as Allen said:

....if you've reached the point where you need to
communicate some sort of heterogeneous aggregation then its time to define
a new class of object. It may seem like a heavyweight approach but down
stream you will most likely be glad you used a new class. Maintainers of
your code will certainly appreciate it.





More information about the Squeak-dev mailing list