aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Searching.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Searching...." Watch "Searching...." New topic
Author

Searching....

Ricardo Estafan
Ranch Hand

Joined: Mar 29, 2004
Posts: 84
Hi guys,

two questions on the search meganism :

1. I created the mechanism in such a way that whatever search criteria is used : starts with or exact match the search operator given name and/or location is NOT case sensitive. I documented this in my choices.txt, but i received a comment from a friend that Exact match is not exact match when it isn't case sensitive... How do you guys feel?
2. I created the search mechanism in such a way if the result of the search is empty => null the old data stays put, so no empty table is shown. I DO show a message indicating there were no results. Is this a proper solution or is it better to show an empty table when there are no results after a search?

Thanks a lot!!
Robert Konigsberg
Ranch Hand

Joined: Jun 23, 2004
Posts: 172
I'll assume you're working on the same assignment I am, Boggitt & whatever.

Originally posted by Ricardo Estafan:
1. I created the mechanism in such a way that (ed: search)... is NOT case sensitive. ... i received a comment from a friend that Exact match is not exact match when it isn't case sensitive... How do you guys feel?

Your friend is right, but that doesn't mean you should follow what he says. (Note I'm still working on my assignment.)

Since there are items that are intentionally ambiguous this is something I chose as well. Here's something you can do if you're uncomfortable with it: Add a method to your implementation that allows for case-insensitive searching. I bet there's nothing in your requirements to prevent that! Cause hey, just because your interface is unclear, that doesn't prevent you from making another method whose interface is clearer! Heck, the find() method in my example doesn't even throw exceptions! I suppose I could wrap find() with


2. I created the search mechanism in such a way if the result of the search is empty, the old data stays put, so no empty table is shown. I DO show a message indicating there were no results. Is this a proper solution or is it better to show an empty table when there are no results after a search?
Thanks a lot!!


There are two ways to answer that question, so I'll answer it twice:
1) Ask yourself these questions: Why do you want to do it that way? What are you trying to provide? What problems might occur due to this? If you can answer those questions satisfactorily to yourself, then go for it and make sure to describe it in your choices file.
2) My Opinion: I am presenting a blank table. I took my lead from software like Microsoft Access which does the same when you query it. I like the idea of a dialog box, though.

Good luck!


SCJP 1.4 (91%)<br />SCJD 1.4 (376/400, 94%)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Searching....