Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

UnimplementedException: bad idea or not?


  • From: David@xxxxxxxxxx (David Byrden)
  • Subject: UnimplementedException: bad idea or not?
  • Date: Sun, 30 Jan 2000 02:04:02 -0000

> From: Chris Kelly <samizdat@xxxxxxxxxxx>



> Is it a bad idea to throw an exception when a feature is not implemented,
> but the caller of the method can't tell beforehand whether that method is
> implemented?


	Remember: seperate your interfaces 
and your implementations.

	If your class or interface describes a
'contract' wherein a method explicitly says that it 
may not be supported, then declare a checked
exception as the means of reporting that. This is
better than returning an error code which programmers 
are liable to use as a value by mistake.

	If your class or interface describes a 'contract' 
wherein the methods are all supposed to work, but you 
are developing and the class is unfinished, then it is a 
bug for a programmer to call that method. RuntimeException 
is for reporting bugs, throw a subclass of that.

					David Byrden
					Java trainer
					http://Byrden.com


---
To unsubscribe, mail advanced-java-unsubscribe@xxxxxxxxxxxxxxxx
To get help, mail advanced-java-help@xxxxxxxxxxxxxxxx