I was using a SimpleDateFormat to validate if a Date was valid or not, I hoped that it will raise a ParseException in case that the format was not yyyy/MM/dd, but it seems that it allows weird dates as 2000/32/57 or 0/0/0, so I would like to know if I can ignore this (because is a bug found in this class) http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6205670 and redo the date to get a valid one or should I validate the whole date,
I create my own interface that extends the DBMain interface and add 2 additional methods, book a room and search for room(s). When book a room it is a bad practice to use update method in the DBMain interface just for updating the customer who book the room, so I create my own interface.
Whenever you implement the validation or not, just document your assumption and the reason for doing so. If the spec doesn't say so, it means that you don't have to do that
For this application, you won't need to create or delete records. However, you must entirely implement the interface that was provided to you. And also, your delete method must use the locking mechanism as well as your update method (note the comments of the lock method in the interface that was provided to you; it says that it locks a record so it can be updated or deleted).
You don't have to verify such thing (if a date is valid or not). But, just for curiosity, here's something I created sometime ago, to verify if a date is valid or not.
And yes, you only have to update the owner field of each record when booking a room. In my case, I have a bookRoom method in a class of the business/services layer, but it uses the update method of the DBMain interface implementation. [ December 24, 2008: Message edited by: Roberto Perillo ]
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD
Are you here to take over the surface world? Because this tiny ad will stop you!
Devious Experiments for a Truly Passive Greenhouse!