Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

And/Or

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In instructions.html:
"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. "
I use two checkboxs and two textfields to implement the requirment. I think there are 3 cases:
a). name
b). lacation
c). name and lacation
But someone else said that there is fourth case: d). name or lacation . What do you think about this??
 
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jhao,
I think you are Ok. There were long discussion about this issue.
We decided that providing opportunity to search by Location and search by Name is indirectly "OR" search. It wouldn't make any sense to enter both fields in search criteria and execute "OR" search.
Best,
Vlad
 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
jhao. I would avoid using the JCheckboxes and JTextFields. I would have JComboBoxes for both fields. And if the user selects values from both, then the query is an AND always.
Mark
 
Vlad Rabkin
Ranch Hand
Posts: 555
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mark,

I would avoid using the JCheckboxes and JTextFields.I would have JComboBoxes for both fields


I would argue this point. In FBN assignement it is required to use JComboBoxes and it is explicitly said , that the list don't have to be updated if the database changes.
In URLyBird there is no requirement to do so. If do it, then we should find excuse not to update list of names/location everytime database changes.
Why are you not happy with JTextFields? You are the one who always said "Make it simple!"

And if the user selects values from both, then the query is an AND always.


I would argue it also:
If you use JComboBox, the user is not obliged to choose items in both JComboBoxes. You can leave an item in JComboBox lets say "any". In this case indirect "OR" search requirement is also satisfied.
Best,
Vlad
[ September 17, 2003: Message edited by: Vlad Rabkin ]
 
Mark Spritzler
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

In FBN assignement it is required to use JComboBoxes and it is explicitly said


Actually that isn't specifcally stated in the instructions.html.
Also JComboboxes are the easiest, because the user doesn't ahve to worry about how to spell what they are searching for, or put in invalid entries. With a JComboBox the user just selects values that are already there. JComboBoxes are also the stadardized way of displaying data like this in a user interface, it is considered preferred over the JTextField in this situation.
Mark
 
Be reasonable. You can't destroy everything. Where would you sit? How would you read a tiny ad?
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic