My assignment states "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. "
When it says "search the data for all records", does it mean that the user can search by all *fields* in the database? Or just city and hotel name?
I was going to only have two searchable fields being city and hotel name. The user can search based on: (1) City only (2) Hotel Name Only (3) Both City and Hotel Name If both city and hotel name are populated, then #3 is assumed.
Does this sound correct?
Also, I don't really have a primary key defined as I don't see a need for one. The search characteristics are pretty simple and the data file itself allows for multiple values. Is this a good assumption?
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.
The distinction I made was that the two requirements are to be implemented in different layers of the application.
i.e You must implement the Data interface and therefore the find method should return the records that start with the search criteria supporting the ability to search EVERY field. Thereby keeping the data layer generic and not linked to search for location etc.
However in your business layer you need to implement the business requirement and perform additional filtering of the returned records to ensure they exactly match name/location fields.
Hope it helps
Jason [ September 12, 2007: Message edited by: Jason Moors ]