I�ve read a number of posts regarding the find mechanism and have ended up making myself more uncertain than before.
I�ve tried to make my database layer as generic as possible, therefore I written my find method to support searching of criteria against all fields, and limit the search to name/location within the GUI layer.
The doubt that I�ve got ringing in the back of my head is do we need to support logical �AND� and �OR� conditions. I�ve currently only implemented the �AND� condition, so any records must match criteria for all fields that are not null.
My reason for this is that I can not see a sensible (or simple) way of implementing the �OR� condition with the current find method signature, and from an application point of view it doesn�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 is :
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
Is this how you have interpreted the requirement? I�m trying to keep everything as simple as possible, and feel that the find method signature does enable the support of a complex search that you may find in a SQL database.
Thanks
Jason [ March 13, 2006: Message edited by: Jason Moors ]
To me this requirement just means that the user can select :
Just the name
Just the location
Both name and location
That is it, do not overthink it.
SCJP, SCJD, SCEA
Jason Moors
Ranch Hand
Joined: Dec 04, 2001
Posts: 188
posted
0
Thanks for the clarification!
I'm really enjoying this assignment, and I'm doing my best to keep it simple! However sometimes I think Sun are playing mind games with the requirements, as one minute I think I clearly understand everything and the next minute I start second guessing myself!
Just think of the implications otherwise. It would mean you would enter for example "name: Teddy, Location: Xanadu" and get all records where either the person is called Teddy OR the person is located in Xanadu. That's just not logical, you want persons called Teddy who live in Xanadu.
42
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: Implementing 'AND' and 'OR' logic in Find method.