When doing a search from the GUI my project states
It must allow the user to search the data for all records, or for records where the name and/or location fields exactly match values specified by the user.
As the find method (from the Sun interface) is implemented in a slightly different way to the requirements outlined in the GUI, do you think it would suffice to ask the user to surround their search text in say, square brackets, (and of coures make sure that this in the user help section)? So, for instance if they wanted all Hotels in Smallville they would have to type [Smallville].
This would fulfill the requirements of the GUI and the implementation of the Sun interface.
Let me see if understand you correctly, you want to implement the find method, to search for fields start with search criteria unless the fields is surround with square brackets if so you will search for exact matching.
If what I understand was correct, I have the following comments: 1- I think by doing so you are violating DB interface, witch dose not mention any special case, it says the find method searches for records where record fields start with the criteria field (I am not %100 sure about it). 2- Even if you are not violating sun requirements, your database side should be as general as possible with your design you may face the following problems:
- Your server may serve different clients, each with its special requirements.
- Let us say a new field will be added to database records phone number for example, and its with the following format (####)(#######), I guess your find method will have a problem here it�s will return only the records with exact match with the phone number.
Now you have the following choices: 1-Keep your code as it. 2-From server side return all partially match records, then when received at client side make some another filtering to the records so they match you search mechanism, which is for this kind of clients, match exactly Location and Hotel name, but in this approach you have a wasted network bandwidth.
So if it is acceptable by sun to write find method as you suggested, you facing those two choices, what you choice depend what important for you and your project maintainability or performance.
At the end this is just my point view, I hope it will be helpful.
[ June 22, 2004: Message edited by: Omar Kalaldeh ] [ June 22, 2004: Message edited by: Omar Kalaldeh ]
Best Regards <br /> <br />Omar F. Kalaldah<br />---------------------<br />SCJP, SCJD, SCBCD
Joined: Jun 21, 2002
Thanks Omar for your thoughts. I'll have a think about your second option. I think you're correct in saying that I should keep the server side as general as possible.