permaculture playing cards
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes URLyBird: create()/update() and Owner ID Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "URLyBird: create()/update() and Owner ID" Watch "URLyBird: create()/update() and Owner ID" New topic

URLyBird: create()/update() and Owner ID

Leo Ho
Ranch Hand

Joined: Mar 31, 2005
Posts: 36
Hi folks, should I check for a valid owner ID when performing create() and update()? Currently, in the book(), I do check if owner ID is a valid one (8-digit number), otherwise I would throw an exception; but not sure if I should do the same with create() and update()


Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 918

Hi Leo,

In my case I assume that the owner are all correct this because in my specs I have somethig like :

The id value (an 8 digit number) of the customer who has booked this. Note that for this application, you should assume that customers and CSRs know their customer ids. The system you are writing does not interact with these numbers, rather it simply records them. If this field is all blanks, the record is available for sale.

Apropos booking what you do by booking ?
I just modify the last field(Customer holding this record) for the booked record. and on release I "blank" this field.

[ April 20, 2006: Message edited by: Mihai Radulescu ]

Leo Ho
Ranch Hand

Joined: Mar 31, 2005
Posts: 36
Thanks Mihai. I end up validate the customer ID in create() and update() in my business service code since I believe that those functions should expect that the CSRs may mistakenly enter invalid customer ID.

For booking, I read the record from the file, make sure the owner field is blank and then set the new owner into it, then call dbMainImpl.update(data)

I agree. Here's the link:
subject: URLyBird: create()/update() and Owner ID
It's not a secret anymore!