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 About URLBirld booking! 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 "About URLBirld booking!" Watch "About URLBirld booking!" New topic
Author

About URLBirld booking!

peng qingtao
Greenhorn

Joined: Feb 20, 2004
Posts: 6
The database defined by the assignment gives me seven fields:
Hotel name, location, size,smoking,rate,date,owner
The assignment explained that "size" means maxinum number of people
permitted in the room.
So,my question is when the customer booking the room,does he need to
define the size.
That's is to say, the customer only want to book the part of the room's bed.
Is it possible to distribute a room to serval people who don't know each other?
"size" is so ambiguous!
Could anyone give me a explanation?
Thanks a lot!
George Marinkovich
Ranch Hand

Joined: Apr 15, 2003
Posts: 619
Hi Peng,
I think you need only be concerned about the name and location fields for searching purposes, and the owner field for booking purposes. The other fields (size, smoking, rate, and date) are there but you don't really have to do anything with them (except for displaying them to the user in the JTable). I didn't have your assignment so maybe someone who did can confirm this.


Regards, George
SCJP, SCJD, SCWCD, SCBCD
Xie Ruchang
Ranch Hand

Joined: Dec 25, 2003
Posts: 160
Hi
I did UrlyBird. I separate in my justifications, two kinds of requirements, Business and System. The System's requirements are what you must implement. What you mention is relating to the Business requirement. That you can assume the CSR to handle and nothing to do with the implementation. Thing like a customer book a room of 4 and 5 check in, etc. The validation of 48 hours can be classified under business requirement. Then one strange thing is there is one who failed the whole assignment without implementing the 48 hours requirement. I didn't implement this and I carefully document it in my Choices.txt. I passed recently.
My GUI allow search on the Hotel, Location and plus Date for your information. George mentioned earlier his have hotel and location.
Best Regards
[ February 25, 2004: Message edited by: Frankie Cha ]
George Marinkovich
Ranch Hand

Joined: Apr 15, 2003
Posts: 619
Frankie,
Originally posted by Frankie Cha:
My GUI allow search on the Hotel, Location and plus Date for your information. George mentioned earlier his have hotel and location.

You're right, I missed date.
It would be a pretty poor hotel reservation system if it didn't include date.
Ste Graham
Greenhorn

Joined: Sep 15, 2003
Posts: 23
However, in my assignment outline (it's URLyBird 1.3.2) it says in the User Interface section:
It must allow the user to search the data for all records, or for records where the name and/or location fields exactly match values specified by the user.

I assume from this that I only need to be able to do field specific searches for these two fields and that's it (i.e. name and location - nothing else)? So providing a facility to search the date is "work beyond the requirements of the specification"?
One question I do have is regarding the find method. Here's what it says in the spec:

How are people doing field specific searches using the String array? I can understand that using an array would be good just to send words (strings) and then just search x field(s) using these words. But if I wanted to search the name field and only the name field using the find method how would I specify that? I'm sure the array is meant to only store search terms? One way would be to have each array item look something like:
name:joe's Hotel
name:The white swan
location: New York
and then spilt the value into two strings using : (or whatever seperator). Maybe this doesn't matter? I'd be interested to hear what other people are doing?
Stephen
George Marinkovich
Ranch Hand

Joined: Apr 15, 2003
Posts: 619
Hi Stephen,
You're right, only the name and location fields are required to be searchable. So I was right the first time, and shouldn't have corrected myself. Now I'm doubly embarrassed.
The purpose of the search IMO is to limit the number of records you have to look at (not necessaryily to narrow it down to a single record). So it's appropriate that the search narrow the records down to a particular hotel name or location (or both), and then the user can pick from those displayed the record that has the date of interest to him.
Originally posted by Ste Graham:
How are people doing field specific searches using the String array? I can understand that using an array would be good just to send words (strings) and then just search x field(s) using these words. But if I wanted to search the name field and only the name field using the find method how would I specify that?

To search for a name:
String[] criteria = {"Dogs With Tools", null, null, null, null, null};
To search for a location:
String[] criteria = {null, "Hobbitton", null, null, null, null};
To search for both name and location:
String[] criteria = {"Dogs With Tools", "Hobbitton", null, null, null, null};
Ste Graham
Greenhorn

Joined: Sep 15, 2003
Posts: 23
George - thanks very much for the prompt reply. I like the search model you outlined! I just hadn't looked at it like that. Ta!
Stephen
Xie Ruchang
Ranch Hand

Joined: Dec 25, 2003
Posts: 160
Hi Stephen
I think we should not interpret that the "musts" specify in the assignment as mandatory AND exclusive.
It must allow the user to search the data for all records, or for records where the name and/or location fields exactly match values specified by the user.

If you take the interpretation as you posted, then there is no room for wild card search as the above statement says exactly. The specification does allow room for reasonable interpretation. It must allow the user to search the data for all records or... It doesn't say how, I determine the how by wildcard for hotel, location and date. This is still within the specification.
If you look closely at the API which you quoted

// Returns an array of record numbers that match the specified
// criteria.
// Field n in the database file is described by criteria[n].
// A null value in criteria[n] matches any field
// value. A non-null value in criteria[n] matches any field
// value that begins with criteria[n]. (For example, "Fred"
// matches "Fred" or "Freddy".)
public int [] find(String [] criteria)

It does allow room to search for ALL fields in the database, not only the hotel, location and date, but also the rest of the fields. Having said that, we have to justify why we want to do it. That is another issue altogether and the Examiner will see why we chose a particular approach.
George, think you are right the second time.
Best Regards
George Marinkovich
Ranch Hand

Joined: Apr 15, 2003
Posts: 619
Frankie,
The best thing about saying two totally opposite things is that you're guaranteed to be right 50% of the time.
Originally posted by Frankie Cha:
George, think you are right the second time.

I agree with you.
peng qingtao
Greenhorn

Joined: Feb 20, 2004
Posts: 6
Seeing the words all of you,i am more clear about the concerpt.
Another question is ,When the customer takes a booking,
does he need to input his id value?
And after room is booked,how do i handle this record in the UI.
i think there are two choices:
the first,delete the record from the JTable
the second,make the record in the JTable with a flag
Xie Ruchang
Ranch Hand

Joined: Dec 25, 2003
Posts: 160
Third put the customer id in the JTable!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About URLBirld booking!
 
Similar Threads
URLyBird - Data file spec
NX: owner and Maximum occupancy
Reason of lock/unlock only 1 record?
UrlyBird Booking records problem
The solution of usage efficiency of room, please talk about it.