Smalltalk beep -> XXX beep?
Stephane Ducasse
ducasse at iam.unibe.ch
Wed May 14 07:26:08 UTC 2003
Ok I will propose a new design soon and I want to have your comment on
that.
The idea is to have
Beeper beep
calling the primitive if no Sound is available
Beeper beep
calling the cool sound when the sound system is available
SampleSound>>initialize
could do
Beeper setDefault: self beepSound
Stef
On Wednesday, May 14, 2003, at 03:20 AM, Andreas Raab wrote:
> 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
|