[Biojava-l] Immutable objects and ChangeListeners

Tom Oinn tmo@ebi.ac.uk
Mon, 08 Jan 2001 18:47:59 +0000


Keith James wrote:
> 
> I have a question re. objects designed to be immutable under all
> circumstances and yet implementing Changeable.

<snip>

> As the methods are not allowed to throw exceptions, how can you
> politely say "Are you sure you want to listen for changes - this
> object is immutable" ?

In this case it's likely to be an error in the application code isn't
it? You can always throw a RuntimeException of some kind in this case.
It's not very 'polite' but you wouldn't expect it to every appear in a
finished application, it would only do so if there were errors I would
have thought. 

Tom

--
This ant has performed an illegal operation 
and must now explode violently.