"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've seen someone interpret this on this forum as meaning that you must be able to do all the following:
1. Search for records that match a particular name. 2. Search for records that match a particular location. 3. Search for records that match both a name and a location. 4. Search for records that either match a particular name, or a particular location, or both.
It's (4) I've got issues with. I think that 1-3 could be argued to be enough to meet the spec - it's only if you read every "or" as a "||" that (4) seems necessary.
Has anybody not provided 4 and passed the assignment?
Okay, to pin down what I'm talking about, some pseudocode:
1. if (record.name == nameCriteria) 2. if (record.location == locationCriteria) 3. if (record.name == nameCriteria && record.location == locationCriteria) 4. if (record.name == nameCriteria || record.location == locationCriteria)
Does that help explain what I mean?
Incidentally, the reason I'm reluctant to implement (4) is just that the way I've designed my database layer means that implementing it would mean quite a lot of code changes. My database logic is a little too clever and abstracted for its own good
Some people have implemented the search window so that as well as 'contractor name' and 'location' fields, there are radio buttons labelled 'and' and 'or'. With this design, if both name and location criteria are specified, the 'or' radio button corresponds to searching using approach (4).
I only implemented the �AND� condition, so any records must match criteria for all fields that are not null.
My reason for this was that I couldn't see a sensible (or simple) way of implementing the �OR� condition with the current find method signature (without adding a new search method), and from an application point of view it didn't make sense to me to support a search where you could allow the user to select a name of a hotel OR and location.
However one of my must requirements was :
Must allow the user to search data for all records, or for records where the name and/or location.
To me this requirement just means that the user can select :
Just the name
Just the location
Both name and location
I know alot of people have passed with this assumption, and just tried to keep everything as simple as possible, I felt that the find method signature doesn't enable the support of a complex search that you may find in a SQL database.
Cheers, Jason [ June 23, 2008: Message edited by: Jason Moors ]
Catch Ernie! Catch the egg! And catch this tiny ad too:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth