This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes NX: find method in urlybird 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 "NX: find method in urlybird" Watch "NX: find method in urlybird" New topic
Author

NX: find method in urlybird

Yanick Labelle
Ranch Hand

Joined: Dec 29, 2003
Posts: 50
Hi, I'm confused by what Sun asked me to do:
The user interface must provide exact match search on the City and/or Hotel name. (or all the records if no search information is provided)
The DB interface specifies that the find(String[] criteria) method must provide a starts with search.
(For example, "Fred" matches "Fred" or "Freddy".)
So, my question is : What should I do? or What did you do?
We can't modify the DB interface...
Should I overload the find method in the Data class and have exact search in the new method?
Should I create a class that inherit from the Data class and override the find method? (does not seems like a good idea)
Or simply implement the find method with exact search, ignoring the comment in the DB interface?
Any suggestion would be useful!
Philippe Maquet
Bartender

Joined: Jun 02, 2003
Posts: 1872
Hi Yanick,

1. Should I overload the find method in the Data class and have exact search in the new method?
2. Should I create a class that inherit from the Data class and override the find method? (does not seems like a good idea)
3. Or simply implement the find method with exact search, ignoring the comment in the DB interface?

Not 3 for sure but 1 looks fine.
Even if the title of this very recent thread (Exception chaining) doesn't match this topic at all , it discusses the search issues with additional links which could help you.
Regards,
Phil.
Yanick Labelle
Ranch Hand

Joined: Dec 29, 2003
Posts: 50
Ok, I think I'm gonna overload the find method as you suggested.
Thanks!
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: NX: find method in urlybird
 
jQuery in Action, 3rd edition