A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
Spring in Action
this week in the
Developer Certification (SCJD/OCMJD)
Joined: May 04, 2004
May 19, 2004 16:00:00
The interface I was given in my assignment throws a
in the update, delete and unlock method.
The description says "..if the record is locked with a cookie other than lockCookie".
My first thought was to use
, but this is a runtime Exception and I believe it is bad practice to throw a runtime exception in the middle of the code?
So I made my own
- does this seems ok?
Joined: Jul 28, 2003
May 19, 2004 19:18:00
For me, I just use
since that is what the instruction specifies.
It is ok to get
in the middle of code, as long as you expect it to happen, such as
I do no see any benefits of making your own
class; but for DuplicatedException and RecordNotFoundException class you should make your own.
I play Java for fun.<br /> <br />SCJP / SCJD / SCWCD / SCBCD
It is sorta covered in the
JavaRanch Style Guide
Additional runtime exceptions in DB interface
B&S - Implication of SecurityException in DB interface methods
RuntimeException or Exception
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014