File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes UrlyBird - they take booking only within 48 hours... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "UrlyBird - they take booking only within 48 hours... " Watch "UrlyBird - they take booking only within 48 hours... " New topic
Author

UrlyBird - they take booking only within 48 hours...

ken bonzo
Greenhorn

Joined: Oct 11, 2006
Posts: 11
Hi

I am close to submit, I want to review the way I implemented the booking method:

I do have these requirements :

-"They take bookings only within 48 hours of the start of room occupancy"

-The field owner (customer) is described as follows "If this field is all blanks, the record is available for sale"

- date field has the following description : "Date available : The single night to which this record relates, format is yyyy/mm/dd."

1- which parameters do you provide when booking the room?

I povide the booking date and the duration (which the number of nights the room is booked for) - the date field will be the booking date increased by the duration. I wonder if I am providing more parameters than required?

2- I am getting confused about the role of the owner and date fields, In my implementation the booking request is accepted If (date is today and owner is empty) or (date is tomorrow and owner is empty) or (date is after tomorrow and owner is empty). am I wrong?

3- If available date is yesterday and owner is not empty, do we allow the room to be booked? (it is available but owner is not empty!)

5- If date is after today +48 hours and the owner is empty, do we allow the room to be booked. (it is beyond the scope of 48 hours but not affected to any one!)

Please help

Best Regards
Edwin Dalorzo
Ranch Hand

Joined: Dec 31, 2004
Posts: 961

1- which parameters do you provide when booking the room?


Your approach is interesting, because your are providing the duration. So, you reset the availability date to the end of the reservation period.

In my case I am just setting the ownership of the record and keeping the date as is. I believe that changing the date of record would tell when the reservation period ends, but not when it started, and I my case I believe that the important thing is to know when the client is going to get to the hotel.

Now, it is not stated in the specification, but I guess there should a process, in the future, that allows a client to cancel a reservation or to check out from the hotel, in whose case, the availability date would be reset to a new value.

My booking method signature is: DAOHotel.book(Hotel hotel,String owner). And it simply assigns the value of the owner to the hotel hotel record and updates the corresponing object.

However, as you know,I would not dare to say that your approach is incorrect.


2- I am getting confused about the role of the owner and date fields, In my implementation the booking request is accepted If (date is today and owner is empty) or (date is tomorrow and owner is empty) or (date is after tomorrow and owner is empty). am I wrong?


I am doing the same thing, I determine availability of a room based on the current time plus 48 hours. I do the calculation using a Calendar:



So, basically it is the same thing that your are doing, that might work for today, tomorrow and the day after tomorrow. But I've been feeling like you, that is: is this what 48-hours really mean?


3- If available date is yesterday and owner is not empty, do we allow the room to be booked? (it is available but owner is not empty!)


As I said before, I consider this rooms not available. I assume that another process (unknown to me) of guest checkout or reservation cancelation is responsible of reseting the values of these rooms, or maybe the guest simply decided to stay longer in the hotel. Therefore I consider this rooms not available.


5- If date is after today +48 hours and the owner is empty, do we allow the room to be booked. (it is beyond the scope of 48 hours but not affected to any one!)


I consider these cases as "not available". And this particular case I would not risk to do otherwise.
[ October 11, 2006: Message edited by: Edwin Dalorzo ]
 
 
subject: UrlyBird - they take booking only within 48 hours...
 
Similar Threads
UrlyBird : question about the owner
Booking the selected record
taking bookings only within 48 hours of the start of room occupancy
Passed SCJD with 390 / 400 (97,5%)
An issue about record booking