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.
You have to show all the records that exactly match.
One solution proposed in other threads of this forum was to create an intermediate class which filters all the results of "Data find(String criteria);" and returns only the records that exactly match.
add a method in Data class, it is used as a switch, maybe called setExactlyMatch(boolean e), then your 'find' method should check the flag first. You can also do it this way, use a compare interface, have two different implementations, one uses exact match, another uses 'rough match', then your setExactlyMatch method should change the 'compare' reference to appropriate instance, so your 'find' method just need to use the compare reference without checking ;-)
Yours Sincerely Olnex
[SCJP 1.2, SCJD, SCWCD]
Joined: Feb 20, 2003
Thanks for your replies.
Maybe use a filter to perform "exactly match" and a switch to "roughly match" in the client is good.
Add a method in Data class used as a switch ,it also means all client either use "exactly match" or "roughly match".So I think put the switch in client side is better.
But I choose use a filter only to make things simple.
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: URLyBird: What is "exactly match" in URLyBird?