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 search requirement 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 search requirement" Watch "urlyBird search requirement" New topic
Author

urlyBird search requirement

Inuka Vincit
Ranch Hand

Joined: Aug 10, 2004
Posts: 175
The search requirment is specified as follows:

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 am confused about the part I have in bold. Does it mean to display all the records or does it mean that the user needs a search function that allows the user to search any given record? I interpreted it as needing a search function search all the records

I searched previous posts and most of them only talk about searching just the name and location, just want to see what you guys think.

thanks
[ October 19, 2004: Message edited by: Inuka Vincit ]

MCP (C# application dev 70-316) 860<br />SCJP 1.4 100% SCJD (URLyBird) 378<br />MAD 100% nuts
peter wooster
Ranch Hand

Joined: Jun 13, 2004
Posts: 1033
Originally posted by Inuka Vincit:
The search requirment is specified as follows:

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 am confused about the part I have in bold. Does it mean to display all the records or does it mean that the user needs a search function that allows the user to search any given record? I interpreted it as needing a search function search all the records

I searched previous posts and most of them only talk about searching just the name and location, just want to see what you guys think.

thanks

[ October 19, 2004: Message edited by: Inuka Vincit ]


It means that your search must be able to return all records, the trickier part of that requirement is the phrase "name and/or location". Does that mean "name or location or (name and location)" or does it mean "name or location or (name or location) or (name and location)"?
Inuka Vincit
Ranch Hand

Joined: Aug 10, 2004
Posts: 175
thanks peter,
for the second part just including all combinations not too hard in the GUI considering I was going to include the ability to search every single field. A little less now.
jiju ka
Ranch Hand

Joined: Oct 12, 2004
Posts: 306
I interpreted it as

Return all records if name and location are not specified.
Return (exact match)...........if name alone is specified.
Return (exact match).......if location alone is specified.
Return (exact match)....if name and location is specified.

An issue I had on this is little off context the discussion here. Excuse me if this is wrong place to put it.

My database contains a delete flag (2 byte) and a booked field(owner - empty if not booked). Question is do we need to include deleted and booked in search resultset. Obviously both are not available to book.

1st thought
The purpose of the search is to do an activity called reservation. During the reservation activity do the customer support needs to see not available (already booked and non existing) locations?

2nd thought
A reservation activity compresses of the following two transaction. Search or query the data collection to match the search criteria. Then update one record among it if needed. There is possibility of another not available record becoming available. The user can see the date available field to see when a particular record becomes available eventhough the record is booked. Displaying the not available record will help user to take a decision to wait. But does displaying the deleted record have any use?
Mogens Nidding
Ranch Hand

Joined: Mar 08, 2004
Posts: 77
Jiju: My database contains a delete flag (2 byte) and a booked field(owner - empty if not booked). Question is do we need to include deleted and booked in search resultset. Obviously both are not available to book.

My two cents: The purpose of searching might not always be to book a record. A plausible scenario is that a customer calls in and asks a sales representative to confirm that the customer already has a booking. Also with respect to future expansions, many more operations (such as unbooking) can be expected to become available. Therefore, you should not filter out booked records in my opinion.

As regards the deleted flag, I agree with you in that I cannot see a purpose with showing deleted records either - the fact that they (temporarily) keep existing physically in the database file even though they are deleted is purely an implementation detail that makes it easier (and faster) to code the delete operation. Compare it to the file system on your hard drive: Even though you delete a file (and empty the recycle bin), the actual file contents will keep existing physically on the hard disk for a long time, but you certainly don't want to see it except in really rare circumstances where you want to recover the file - and if you do want to see it, you have to use a special undelete tool.
[ October 20, 2004: Message edited by: Nicky Bodentien ]
Jared Chapman
Ranch Hand

Joined: Feb 23, 2004
Posts: 81
Hi,

I have the B&S Contractors assignment, but our search requirement is exactly the same as you have listed. Also, in the data interface provided with the assignment, is a method called

I implemented my find method by:

1. get all of the vaild records
2. if criteria is null, return all record numbers for valid records
3. using a for-loop, compare criteria[n] with the nth field value in each
record, using a Pattern. If a record's nth field doesn't match the
pattern for criteria[n], remove it.
4. when the for loop completes, you will have an ArrayList containing
only records that match your searching criteria. return their recNos.

The pattern I used was:


This pattern results in the following:

1. user enters name, but no location -> search returns records whose name BEGINS exactly with the name entered by the user. Location isn't a factor in the result.

2. user enters location, but no name -> search returns records whose location BEGINS exactly with the location entered by the user. Name isn't a factor in the result.

3. user enters name and location -> search return records whose name BEGINS exaclty with the name entered, AND whose location BEGINS exactly with the location entered.

4. user enters no information -> all valid records are returned.

If you have String[] criteria = {"", ""}; , all records will be returned, because every name begins with "" and every location begins with "".

So, after all that, I believe the requirement means that the user must be able to search by name, without location being taken into account, by location, without name being taken into account, by name and location, where both are taken into account, or simply return all the valid records in the database.


B.S. University of Wisconsin<br />SCJP 1.4 (85%)<br />SCJD 1.4 (92%) B&S Contractors
jiju ka
Ranch Hand

Joined: Oct 12, 2004
Posts: 306
thanks now the requirement is more clear.
[ October 21, 2004: Message edited by: jiju ka ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: urlyBird search requirement