This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
Does these sound ok (ok in terms of I did it and passed ) ?
1. Is it safe to assume that leading and/or trailing whitespace characters in create/update/find are not allowed, I throw a IAE in such case. My implementation of Data class is rather defensive. If I write " Kate " it's either saved as it is or rejected as invalid and not silently changed to "Kate".
- trailing whitespaces - padding with spaces in db eliminates usage of these
- leading whitespaces - there are none in supplied db file + I don't have implement my own trimTrailing(String) utility method, just a simple trim() does the trick when records are loaded from db. On the other hand goodness knows what the customer wants, perhaps it's safer to allow leading whitespaces to be entered.
2. In GUI I also trim values in search fields (setText(getText().trim())) when user presses the Search button. Since they are internally trimmed for search the user should be aware of that, right ?
3. In GUI empty name/location criteria matches only empty field in db. The * matches any value (translated to null), escape character is \. The * only works as a wildcard if query contains no other characters (requirement for full search matches only).