This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes UrlyBird Booking records problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "UrlyBird Booking records problem" Watch "UrlyBird Booking records problem" New topic
Author

UrlyBird Booking records problem

sohrab khan
Greenhorn

Joined: Sep 10, 2007
Posts: 13
I uploaded the Urlybird 1.3.3 assignment a few days ago and my booking method was:

Update a record in the database file by putting in the customer id in the customer id field

This is how its done:

1. The book method is invoked
2. book method calls read() which retrieves the fields
3. update the fields and then call the update method supplying the new fields
Very very simple...

Well I now realize that thats wrong; since each record in the database represent a hotel and the field "size" means the number of rooms. So you cannot simply update the record by putting in the customer id. That means you are booking the whole hotel for the customer. I think I should have created another record with size 1 and the customer id and updated the original record and decrement the size field.

Am I correct? Has anybody else made the same mistake?


Sohrab Khan SCJP, SCJD, OCPDBA, MCSE
3tons Web Directory | EggDir Directory
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2265
    
    3

Howdy, Sohrab!

Champion, the field "size" indicates how many people fits a particular room. Each record represents one room. When booking a room, only the customer ID field has to be updated. However, one good thing to be done is verify if this field is still empty before updating it.


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
sohrab khan
Greenhorn

Joined: Sep 10, 2007
Posts: 13
Wow that was like the fastest reply ever.

And thank you v.much for the clarification; thank god I haven't made any mistake. This means I'm gonna pass as I've done a lot a testing even cross platform testing (on fedora, ubuntu, windows).
 
 
subject: UrlyBird Booking records problem