Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Some queries regarding Search Criteria

 
David Winters Junior
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I was just wondering what others had implemented in terms of what fields one allows users to search by in the database. Did others stay strictly by the specification or did you extend it to allow the user to seacrh for records by any field in the database

According to the spec in urlybird 1.3.1 it states the following:
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 method comments of the find method in the DBMain interface states the following:

Returns an array of record numbers that match the specified
// criteria. Field n in the database file is described by
// criteria[n]. A null value in criteria[n] matches any field
// value. A non-null value in criteria[n] matches any field
// value that begins with criteria[n]. (For example, "Fred"
// matches "Fred" or "Freddy".)
public int [] find(String [] criteria)
throws RecordNotFoundException;

Also in addition the method comments above and the statement from the spec also seem to conflict. The code comments seem to suggest that a user can search "the name and/or location fields exactly match values specified by the user" however the code comments seem to suggest that the user if the user entered say a location of "Alab" that it will return all fields in the database which begin with these 4 letters.

I am somewhat confused here and i ma interested how others have interpreted this and what search implementations one has provided in their applications

Thanks for the help in advance.
David
 
rohan tiwari
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I too had similar doubts , the following thread would be very helpful to you.

http://www.coderanch.com/t/189579/java-developer-SCJD/certification/specification-GUI-URLyBird
 
David Winters Junior
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rohan,

Thanks alot that clarifies the issue completely. thanks for the link

David
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic