• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

About search in the user interface

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The instrunctions say:

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.



it is enough clear.... but the question is: because it is not possible in the findRecord method of the interface to add parameter to mach exactly or just to mach a substring, this mean if i need to "EXCACTLY MATCH" the values, after the query in the database (asking to match substrings) i should filer again the records in some utility classes?
 
Ranch Hand
Posts: 92
Android Eclipse IDE Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I filter the values fetched from the database once again in my local server implementation.

Regards,

Romeo
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes. Filter in the GUI layer.
 
Ranch Hand
Posts: 329
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes you have to filter them in controller class sitting between GUI and Data to match exact values of Name and Location field with values coming from find() method.
 
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But there is no word in the exam saying only startwith should be supported by your DataAccess class, that means your DataAccess itself can support this kind of an extra mechanism.

Also there is a need identified as "flexible Search Mechanism" should be provided by Data Access. This means you still can add to DataAccessClass, but can have extra functionality added to it.

And there is no restriction that UI will be only using Data interface. Your DataAccess class must support Data Interface. That means extra functionality might be advisable here.
 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I do the exactly matching in my local DBFace. So on Server side.

In my opinion there is no restriction where to do as long as tthe client sees exactly matching.
 
Maurizio Nagni
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes... I have implemented too in the server side this is not a major problem because they require that functionality for the GUI side and because of that you can implement in the layer you preafer....
wow... thank you all! great talk
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I find the AND/OR part confusing. What if the name matches but the location does not? If it is AND this equates to false but if it is OR it equates to true. How have you guys approached this?

Also, do you have a single search textfield in the UI as in Andrew's book? Or two textfields- one for Name and one for Location?

Cheers

Mo.
 
Romeo Son
Ranch Hand
Posts: 92
Android Eclipse IDE Suse
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I do not agree with those that did the filtering on the GUI layer. If the application is started in networking mode, why send wrong values over the network? It is a waste of band.

Unfortunately I cannot purchase Andrew's book (being from Eastern Europe), but I have two text fields in search pane, one for name and one for location.

Regards,

Romeo
[ April 18, 2007: Message edited by: Romeo Son ]
 
Lucy Hummel
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

So Romeo made a valid point to put the stuff on server side:

Originally posted by Romeo Son:
I do not agree with those that did the filtering on the GUI layer. If the application is started in networking mode, why send wrong values over the network? It is a waste of band.



I just allow that the user can search for
  • all non-deleted accomodations
  • non-deleted accomodations that matches name
  • non-deleted accomodations that matches location

  • So I do not allow matching of location and name.

    So I am going to see what Sun thinks about.

    Furthermore, I dropped implementations during writing JavaDoc because
  • not required
  • lazy to document all stuff
  • reduce place where a error might be
  •  
    Mo Negargar
    Greenhorn
    Posts: 6
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Romeo Son:
    I have two text fields in search pane, one for name and one for location.
    [ April 18, 2007: Message edited by: Romeo Son ]

     
    Mo Negargar
    Greenhorn
    Posts: 6
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi Romeo,

    Originally posted by Romeo Son:

    I have two text fields in search pane, one for name and one for location.
    [ April 18, 2007: Message edited by: Romeo Son ]



    This is the approach I have taken but now I am having second thoughts. How do you handle the AND/OR condition? What if the location matches and name does not? Hummel's approach seems more appealing mainly for simplicity reason.

    Any thoughts from anyone else?

    Cheers
     
    Lucy Hummel
    Ranch Hand
    Posts: 232
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi,

    I only search for "OR" in my gui.
     
    Maurizio Nagni
    Ranch Hand
    Posts: 75
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    well.... I agree with the argument of filtering in the server side. If i can add a suggestion for lucy about

    So I do not allow matching of location and name.


    i do not know how do you implement the filtering but in my case when i request a search i just send two parameter (String[] criteria, boolean[] match)
  • the criteria is just the array string about the search
  • match[i] = true mean "please MATCH EXACTLY"


  • so in the server first i search all the records for substrings;

    after, when i do the filter, i just loop over each result item and if


    ok...ok... it include NOT required matches for the other fields but i just initialize to false (the loop is transparent to "false") the array after this i change just the fields for name and location.
     
    Romeo Son
    Ranch Hand
    Posts: 92
    Android Eclipse IDE Suse
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Hi all,

    I did a small API to simulate and/or conditions and used recursive calls in my filter method on the server to see if the search condition matches the contractor.
     
    Vincent Li
    Greenhorn
    Posts: 22
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Mo Negargar:
    I find the AND/OR part confusing. What if the name matches but the location does not? If it is AND this equates to false but if it is OR it equates to true. How have you guys approached this?



    I think it's how you read the English. Do you read the "name and/or location" as:

    1) name, or
    2) location, or
    3) name and location

    Or

    1) name, or
    2) location, or
    3) name and location, or
    4) name OR location

    The addition of the 4th item is where you have values for searching name and location but want a inclusive set. My interpretation is the first set with no complicated "name or location". That interpretation is simply you either enter a "name" to search by name OR enter a "location" to search by location, OR both to search for both. Basically, the premise is you don't need to get a combination of the result of name only AND location only. If you have a value, that's is implicit AND. I believe grammatically, that fully satisfies the criteria as stated.

    After all, where would you stop? How may combinations will you support? If you have a combined "name" or "location", why can't you have a set with 2 names? i.e. I want those that start with A and starts with B? or those in Vancouver and Toronto (location OR location)?


    Also, do you have a single search textfield in the UI as in Andrew's book? Or two textfields- one for Name and one for Location?



    I used 2 search fields. But then, I only got 27/40 in my GUI.

    So, may be there is something to this "OR" thing and something to the dialog.
     
    Consider Paul's rocket mass heater.
    reply
      Bookmark Topic Watch Topic
    • New Topic