Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

B&S Searching By Name: Are U Making The User Enter The Whole 32 Chars? Incl spaces?

 
Bob Nedwor
hangman
Ranch Hand
Posts: 215
Eclipse IDE Oracle Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that I am going to trim() the users input and compare it to the trim() of the name of the record in the database to see if it is a match, right?

Is anyone interpreting this requirement differently, as in actually expecting the user to type in the whole 32 chars with spaces on the end to match it exactly to the whole 32 character name in the db?

Of course, I would do the same with location.

What do you guys think?
 
Ed Tse
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am doing the samething, on top of that, I am doing a toLowerCase() on both side to do a incasesensitive compare.
 
Kai Witte
Ranch Hand
Posts: 356
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello,

because the search criterion modes in the GUI are combined with a clear "must" statement, I decided not to take any chances and to support all possible interpretations of the assignment. This resulted in three search options for the user: exact match including trailing spaces (of course a totally useless feature, but a possible, farfetched interpretation of the assignment), exact match without trailing spaces, and the "starts with" mode.

This resulted in a very, very confusing search form. I don't know if you really want to go that way, too ...

I got 24/40 for the GUI (worst GUI in 2004), full score for the rest.

Kai
 
B Chen
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've have never did or seen a search that included trailing spaces. I think triming the trailing spaces is expected.
I am also not doing case-insensitive search because it is not specified in the requirements. Even the example in the interface ("Fred" matches "Fred" and "Freddy") kind of suggest it should be case-sensitive.
 
Bob Nedwor
hangman
Ranch Hand
Posts: 215
Eclipse IDE Oracle Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to everyone for your responses. I am going to stick with trimming the spaces off the db value to match the users input.
 
Ed Tse
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, the assignment is a bit unclear, but to me, I hate the searches that are case sensitive. I have yet to see a search that is case sensitive only. So it's either case insensitive(google) or it has an option to do both(text editor's searches). Also, I doubt examiner will deduct some point from your assignment because your search is insensitive.
[ March 20, 2006: Message edited by: Ed Tse ]
 
Sergey Zolotaryov
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Strange enough but this did not pose any problem for me. I just made name and location filters the editable comboboxes. Both are filled with distinct values from name and location columns of the database. This way the user does not have to type spaces, and I do not have to guess whether the value is padded with spaces, or it really has spaces as part of the value. No trimming and everybody's happy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic