posted 19 years ago
Hi all,
This question has probably been asked before, but I did not manage to find it in the archives:
My assignment (B&S 2.3.2) states that I must implement a given interface. Some of the methods in the interface are defined to throw specific exceptions which I feel would not necessarily have to occur in my implementation.
For example, my isLocked() method is defined in the interface as follows:
Since I only allow records that are found in the database to be locked, the exception is never thrown for locked records and according to the "contract" I am allowed to return false for all other cases (unlocked records and non-existent records(?)). So would I be cutting corners if I remove the RecordNotFoundException from the implementing class' method?
Thanks for your thoughts,
Frans.
[ December 29, 2004: Message edited by: Frans Janssen ]