Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: Search requirement

 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Below is my instructions:

The User Interface
...
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.

How should I consider this statement?
Example, in the DB, I have the following NAMES:
1. HELLO
2. WORLD
3. EARTH
If the user inputs "AR", should my program returns "EARTH" or throws a RecordNotFoundException?
I think this part is not clear enough.
Thanks.
Nick
 
Vlad Rabkin
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nick,
If the user inputs "AR", should my program returns "EARTH" or throws a RecordNotFoundException?

I don't know if your search method should throw RecordNotFoundException if nothing has been found, but no record should be delivered in the case described by you.
Best,
Vlad
 
Bill Robertson
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nicholas,
You may want to think of having two search sections. One section takes a string that fulfils the "It must allow the user to search the data for all
records" (and also consider making this case sensitive or not case
sensitive or ideally give the user an option). In this part you simply
provide the user with a text field in which they enter a string and then
search ALL fields on that string - not just name and location.
The other section can be two combo boxes or text fields that take
the name and location that fulfills the "or for records where the name and/or location fields EXACTLY MATCH values specified by the user"
requirement. IMO this should be case sensitive because it says EXACTLY
MATCHES.

How should I consider this statement?
Example, in the DB, I have the following NAMES:
1. HELLO
2. WORLD
3. EARTH
If the user inputs "AR", should my program returns "EARTH" or throws a RecordNotFoundException?

If the user enters "AR" in the first section described above I believe you
should return EARTH. Because you are searching on a string. Or also if they
enter "RTH", "EA"...
If the user enters AR in the name field in the second section described above you should not return anything because "AR" does not exactly match
any of your names. Also in the second section you have to decide if you consider a hit if a record matches both the name AND location entered by the user, or you have a hit if the name OR the location match a record. There again you could give the user an option to perform an AND search or an OR search. These are just options to consider.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Vlad and Bill.
I also think that the requirement is divided into 2 parts.
For the 1st part, I think, if the user does NOT enter any inputs into both fields, i.e. Name and Location are both empty, I will retrieve ALL records to the display.
My concern is the 2nd part. I made an assumption that, there are only 3 cases:
Case 1: Name is provided and Location is empty
Simily returns the Hotels that match the input name.
Case 2: Location is provided and Nameis empty
Simily returns the Hotels that match the input location.
Case 3: Both inputs are provided
Returns the hotels that match both input (AND condition)
And I assume that there is no "OR" case.
However, my concern is, using our previous example, if the user inputs "ar", according to the instruction exactly match, I should:
Case 1: NOT return the record EARTH cos NO record is "ar".
Case 2: return the record EARTH since it contains "ar".
Case 3: NOT return the record EARTH since it does not contain "ar".
For the case sensitive or not, I agree with Billy that I can make a radio button for the user to choose, but my concern is, the meaning of the exact match! Should it be:
1. "exactly match the record", e.g. Case 1 and Case 3
2. "exactly match part of the record", e.g. Case 2
Thanks.
Nick.
 
Vlad Rabkin
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nick,
1. "exactly match the record", e.g. Case 1 and Case 3


I would go the way, described in case 1/3.
Best,
Vlad
 
Bill Robertson
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nicholas,
For you Location/Name search its an "Exact Match".
So "AR" in the name field should return nothing unless
someones name is "AR" and only "AR" - like Vlad said.
Thus, this would fall under what you stated as
"1. "exactly match the record", e.g. Case 1 and Case 3"

But in you string search, thats another story, IMO it
should return all records that contain a field that has
"AR" somewhere in it.
Thus, this would fall under what you stated as
"2. "exactly match part of the record", e.g. Case 2"
Also keep in mind for the string search I assume your instructions
want you to search all fields.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic