I would like to validate with you what is the purpose you are giving to the search use case in the URLyBird assignment.
My instructions file says, literally, about the UI:
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.
Originally I thought it was meant to search for available rooms only, in whose case the user could not provide neither the owner nor a date range, because the application is supposed to retrieve only those records of available rooms (owner=null) within a range of 48 hours (date between today and today+48hrs).
But what could possibly mean �to search the data for all records� ? Does this means the application should be able to retrieve all data without any filter (select * from file) or does it mean that the user should be able to filter the data using any of the FIELDS?
The use of the word �record� [/i ] is very confusing to me, for a me a record means a tuple, and the phrase [i] �search the data for all records� means to retrieve all the records from the database, which in any application of the world would be a very stupid thing to do since the file may have thousands of records.
It takes me to the conclusion that the phrase �search the data for all records� might mean filter the tuples using any of the database fields .
If this latter rule is true (or at least what yourselves interpret), it takes me to one more doubt.
What is the business purpose of the search use case? There could be tenths of scenarios, like: to look for available rooms, or to look for the rooms booked on behalf of a particular client, or to analyze the number of rooms occupied in January of the last year.
Since the Sun specification is so weak to describe the business rules the application should engage I cannot be certain if my implementation is good enough to satisfy the universe of possible scenarios of the so called search use case.
At the beginning I was thinking the only purpose of the search use case was to look for available rooms within a range of 48 hours and then book one of them for a client. (Above all because these are the only two use cases the instructions.html file actually requires to be implemented).
Hence I was about to implement the following rule:
But this fails to use all the fields as filters . Because I assume the user wants to find rooms whose owner == null and in a date range of 48 hours, hence I do not provide this fields for the end user, although they are part of the buit-in .functionality
Darn Sun Specification!!!
Whatever the case, how do you interpret the phrase �search the data for all records� ? and what business purpose are you giving to your searches?
A record is any set of data belonging together, it's definitely not necessarilly a tuple. Each entry in a table is a record.
So update your understanding of the word record and see if it makes sense to you now.
And yes, the assignment is often deliberately vague, forcing you to make real decisions of the kind you're going to have to make on a day by day basis when you rise over the level of code monkey in a development team and get to make your own design and architecture choices.
subject: How to interpret "Search the data for all records"?