Got off to a good start on the Java Developers Bodgitt and Scarper, and indeed I've come up with a general find algorithm. But I have a few questions and I'm hoping that someone who did or doing this project can help.
1) There is an & (ampersand) used for the subcontractor name. I'm using equalsIgnoreCase to compare the criteria to the corresponding record but with the finished application I cannot imaging someone using & and instead saying "and". Should I just make some intelligence on this or is there a better way for comparing?
2)Should the find criteria work on finding the "customer holding this record" field?
For your first question, I'd say no. Since it is a name, I guess it would be better to just face '&' as '&'.
I'm not sure if I understood your second question. Do you mean, allowing the user to search also for customer ID?... Take a look at your instructions; in my case, I only had to provide full search and search by name and/or location. Most likely, you don't have to provide a search by customer ID.
In my B&S 2.2.1 instructions, in the "User Interface" section, it reads:
"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."
I took this to mean that name and location searching MUST be case-sensitive. I thought I'd warn you of this, in case your instructions are similar.
Also, I created a complete search capability for all criteria, not just for name and location. According to my B&S instructions the user interface is to be developed with the anticipation of future functionality improvements. So, at some later time if searching using more criteria is required, findByCriteria should already have that functionality, I think.
Grary Stimon wrote:I took this to mean that name and location searching MUST be case-sensitive.
Well, not necessarily... some people chose to create a case-sensitive search... I myself created a non-case-sensitive search. As long as you justify your choice, that's a-ok.
I thought I'd warn you of this, in case your instructions are similar.
Grary Stimon wrote:According to my B&S instructions the user interface is to be developed with the anticipation of future functionality improvements. So, at some later time if searching using more criteria is required, findByCriteria should already have that functionality, I think.
Now, this one is a good choice! I also did that!
The find-method in my Data class is a case-insensitive search where the different criteria are OR'ed (so 1 match is enough, a null criterium is ignored) and a startsWith check is executed. You can search on all possible record values (hotel name, location, smoking, customer-id,...), but in my application only hotel name and location are used (for the other ones I did a selective test in my Data class test case).
If the name contains a &, - or ' for example, these symbols should be entered, no artificial intelligence added to translate for example 'and' into '&' (the assignment is difficult enough without it )