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:Case Sensitive or Not?

 
Satish Avadhanam
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,
Another doubt I got is that in the Sun provided method, findByCriteria() method, the requirement says that
A non-null value in criteria[n] matches any field
// value that begins with criteria[n]. (For example, "Fred"
// matches "Fred" or "Freddy".

If suppose I am providing the search option for all fields, then should I consider the search case sensitive or not? I mean, if a person wants to find all hotels in "Las Vegas" & "No Smoking", then the CSR may want to check all the records for the criteria. Now if CSR enters say "n" instead of "N" for non-smoking, then should I return all those records too?
If we just go ahead and ignore case while comparing the fields and document the idea, is it fine?
Appreciate your suggestions & ideas. Thanks.
 
Philippe Maquet
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Satish,
If we just go ahead and ignore case while comparing the fields and document the idea, is it fine?

From another thread, I remember that you use search combo-boxes instead of textfields (which is a good idea IMO). And with such a GUI, you don't risk that a user will search for "frED" instead of "Fred". So I don't think that a case-insensitive search brings anything, except the risk to do something that SUN doesn't expect.
Regards,
Phil.
 
Satish Avadhanam
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok Phil, I will go with your ideas. Thanks.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Satish,
I did implement the case insensitive search, by providing 2 radio buttons: Exact Match and Similar.
If the user search with Exact Match, the exact result set will be returned. Otherwise, similar records (like FreD, FRED and FR) will be returned if the input string is "fr".
Of course, I have implemented another method to cater this. The method given by SUN does not allow us to pass in the parameter for the search method, and thus, I have my own search(int mode, String[] criteria). I have also implemented the given method as well.
Finally, remember to document this in choice.txt.
Nick.
 
Satish Avadhanam
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Nick. I got it. I'm analyzing on which way to go - as suggested by Phil or you. But thanks for sharing your ideas.
Appreciate it.
 
George Marinkovich
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Satish,
Originally posted by Satish Avadhanam:
Thanks Nick. I got it. I'm analyzing on which way to go - as suggested by Phil or you.

I would follow Phil's suggestion on this one. Providing the ability to do wildcard matches is not required for the assignment. I did something in my own project very similar to what Nick suggests, so of course I don't think it's wrong to do so, but I do believe it's an extra feature beyond the scope of the project. If you can't trace a feature that you provide back to the requirements, then I think you should probably not provide that feature. Simpler (assuming you satisfy all the project requirements) is better.
[ February 24, 2004: Message edited by: George Marinkovich ]
 
Satish Avadhanam
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok George. What you said is also right, I mean why go beyond the scope of project and make things complex while we are already and with the given requirements only .
Thanks.
[ February 24, 2004: Message edited by: Satish Avadhanam ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic