Smalltalk beep -> XXX beep?

Andreas Raab andreas.raab at gmx.de
Wed May 14 01:20:46 UTC 2003


Hi Stef,

[#beep in SampledSound]
> I defined beep on SampledSound to avoid to have hardcoded 
> reference and a class referring to its subclasses.

While you are correct in general, I think that this solution is not the best
one in practice. What you're doing here is requiring SampledSound to be
present in order to beep while one can very well argue that this should be
handled by FMSound or similar. So any one of the concrete subclasses could
take on the responsibilities for knowing how to beep.

Considering this, I would claim that the "right" way of solving this problem
is to have a (probably class) variable which stores the sound to use. So
that one could use arbitrary sounds as the 'default beep sound'.

Cheers,
  - Andreas



More information about the Squeak-dev mailing list