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 B&S Searching By Name: Are U Making The User Enter The Whole 32 Chars? Incl spaces? 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 "B&S Searching By Name: Are U Making The User Enter The Whole 32 Chars? Incl spaces?" Watch "B&S Searching By Name: Are U Making The User Enter The Whole 32 Chars? Incl spaces?" New topic
Author

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

Bob Nedwor
hangman
Ranch Hand

Joined: Aug 17, 2005
Posts: 215

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?


Bob N
SCJP - 1.4
SCJD - (B&S) Used 1.5 And It Runs On Solaris10
SCWCD - Thanks to HFSJ!!
Ed Tse
Ranch Hand

Joined: Sep 18, 2003
Posts: 183
I am doing the samething, on top of that, I am doing a toLowerCase() on both side to do a incasesensitive compare.


SCJP, Pre-SCJD (URLyBird 1.3.1), Teradata Cert'd Prof
Kai Witte
Ranch Hand

Joined: Jul 17, 2004
Posts: 356
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


Kai Witte's business website Kai Witte's private homepage
B Chen
Ranch Hand

Joined: Dec 27, 2005
Posts: 89
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.


SCJD<br />SCJP 1.4
Bob Nedwor
hangman
Ranch Hand

Joined: Aug 17, 2005
Posts: 215

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

Joined: Sep 18, 2003
Posts: 183
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

Joined: Mar 14, 2006
Posts: 26
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: B&S Searching By Name: Are U Making The User Enter The Whole 32 Chars? Incl spaces?