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

Search functionality ?!

 
josine wilms
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

In my assignment it says for the User Interface:
"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."

For the method find(String[] criteria) it says:
// 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".)

I'm confused.

Does this mean that:
There are two types of search functionality needed in the GUI:
1. Exact name matching for name and/or location.
(for example: dropdown box with search button)
2. Fuzzy searching on any cell value
(for example: text field for free format text with search button)

You could make use of the described find() method for both search options, but one might bite the other: you search with exact name matching eg location "York" but will then also get the results because of this method for "Yorkshire".



How do you guys interpret both reqs as a consistent whole?

Thanks,
Josine
 
Dalton Filho
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anything impeding you from adding another (more flexible) search method on your data class?
[ September 11, 2006: Message edited by: Dalton R. Filho ]
 
Thirumurugan Mylrajan
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by josine wilms:

Does this mean that:
There are two types of search functionality needed in the GUI:
1. Exact name matching for name and/or location.
(for example: dropdown box with search button)
2. Fuzzy searching on any cell value
(for example: text field for free format text with search button)
[/QB]


I would advice that you do not mix database requirements and GUI requirements. The database should work even without the GUI(Any client can make use of the DB calls).

Considering the above, the requirement for DB is that a find method is required in the DB which will give partial match.

The requirement for the GUI is that find should return exact match.

You can fill in the gap by 1. filtering the unmatched records in the client. 2. Adding another method in DB.

I used the latter.
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, josine

Regards MThe database search must be generic because it must serve different clients.
Each client can have other search methodology(and one of this can be the exact match for one or two rows).
In this way you can use more than one client type with the database(at least from the search point of view).

Regards M.
 
josine wilms
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Thanks to you all for your very helpfull answers. I got a new look on the whole.

Josine
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic