• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

urlyBird search requirement

 
Inuka Vincit
Ranch Hand
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
peter wooster
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 175
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
jiju ka
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks now the requirement is more clear.
[ October 21, 2004: Message edited by: jiju ka ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic