About use of specific error
stéphane ducasse
ducasse at iam.unibe.ch
Sun Mar 5 11:28:04 UTC 2006
>
> Obviously you *could* do that and if you wanted to explicitly
> handle a case of the key not being found in your collection it
> might be the best thing to do. An 'ifAbsent:' block is great when
> there is a simple failure case and a simple failure response. I
> don't think it is so useful when things get more complex and there
> are many possible problems to handle.
>
> For an in-memory OrderedCollection, at:ifAbsent: is extremely
> useful and since pretty much the only thing that can go wrong is
> the index being outside the collection bounds it covers the problem
> nicely. For a caching collection hiding a connection to a database
> I suspect that there are more things that can blow up and more
> nuanced responses that one would like to provide.
Indeed, I think that this was with the vision that Java was a
language for internet (wild and unknown area) that lot of exceptions
introduced and stressed.
Stef
More information about the Squeak-dev
mailing list
|