I am implementing the search feature required by the interface that Oracle provides. The JavaDoc that Oracle also provides says something similar to the following:
A non-null value in criteria[n] matches any field value that begins with criteria[n]. (For example, "Bill" matches "Bill" or "Billy".)
My implementation currently performs a case sensitive match (essentially uses String.startsWith). From the point of view of implementing the required interface I believe that this code therefore passes the requirements. However, from a usability point of view for the user it is not very good as the search feature would not return any results for "bill", whereas it would for "Bill"...
I would much prefer to perform a case insensitive match, but I am nervous that I might violate a requirement of the Data class implementation and automatically fail. I would appreciate it if anyone could give any guidance on this.
I'd say this is pretty much a matter of choice, which you'll have to explain in your choices.txt file. For instance, you could say that you read the JavaDoc, and since it said "Bill" matches "Bill" or "Billy", you assumed that it had to be case sensitive, because of the 'B' character. Or you can also say that your search is case insensitive because it is more user friendly. Either choices are fine. I don't have my code here right now, but I think my search was case sensitive too (startsWith()).
David Goate wrote:I would much prefer to perform a case insensitive match, but I am nervous that I might violate a requirement of the Data class implementation and automatically fail. I would appreciate it if anyone could give any guidance on this.
No need to be nervous: I implemented a case insensitive search in Data class and passed with full marks Of course in the GUI itself only the exact matches are shown when searching.
David Goate wrote:if your data class allowed case insensitive search, I would imagine that so did your GUI?
No, it does NOT. My Data class uses a case insensitive search. But according to instructions only exact matches should be shown in the table when searching. So the records returned by the find-method of Data class are filtered by my business service and only the ones exactly matching the criteria entered by the user are shown in the table.