File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Exactly match searching in URLYBird Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Exactly match searching in URLYBird" Watch "Exactly match searching in URLYBird" New topic
Author

Exactly match searching in URLYBird

Zhixiong Pan
Ranch Hand

Joined: Jan 25, 2006
Posts: 239
Hi all,
Comments in assignment 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.
My opinion is searchAll will call read() with all recNo. Tow JTextField instances will be created and added to client UI. So search means both the two conditions name and location should be satisfied. When instance which stands for name is blank, I will search for records only exactly match location fields values. It is similar when instance which stands for location is blank. When both of them are blank, search now equals the meaning of searchAll. At first I want to utilize find in Data to realize search. Howerver, comments regarding find say
//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".)
.
So can you see the collision here? Then I decide to overwrite find, with passed parameters name (String ) and location (String) ,and this time find will do exactly matching. How do you think so?


SCJP 1.4 SCJD
Ed Tse
Ranch Hand

Joined: Sep 18, 2003
Posts: 183
I don't see the collusion. Please explain your concern more clearly?

I also was wondering if we need 2 Textfield for search criteria.
[ March 26, 2006: Message edited by: Ed Tse ]

SCJP, Pre-SCJD (URLyBird 1.3.1), Teradata Cert'd Prof
LianGuang Wang
Greenhorn

Joined: Mar 26, 2006
Posts: 11
i have the same doubt!but i prefer to exec another match in the results of the find in the initial interface!who can give a clear answer?
Zhixiong Pan
Ranch Hand

Joined: Jan 25, 2006
Posts: 239
Hi Hot,
Your way
to exec another match in the results of the find in the initial interface
is better than mine. I think we should not add any method to Data which implements DB. Also waiting for an clear explanation.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11404
    
  81

Hi Zhixiong,

Consider this from the perspective of a large company developing this program:
  • The server side staff have to create a generic search facility that will do "starts-with" searching.


  • They may not be aware of the GUI programmer's requirements, or they may be aware of two (or more) different groups who all want to do searches (so they are creating a generic interface). We don't know. All we know is that the server programmers have been told to create a server-side "starts-with" search.

  • The GUI programming team have been told to make an application that is very specific to the needs of the users who will be using the system.


  • So the GUI programmers will be developing a client-side exact-match system.

    This has nothing to do with how the search facility on the server-side works.When you look at it like that, it might be possible to see that there is no real problem: what you are seeing as a problem is only because you are trying to develop one application rather than considering from the view that there are two separate applications (client and server).

    To further divorce the concept between performing a search and displaying data, the search method does not return records - it returns record numbers. You have to retrieve the records based on the numbers in a separate step. So you would presumably be validating that the records still matched anyway (otherwise the records could change between when you complete the search and when you retrieve the record).

    Also you have even been told that there are other applications working with the data, so having a more generic API than you really need that has methods you don't need should come as no surprise.

    Regards, Andrew


    The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
    Zhixiong Pan
    Ranch Hand

    Joined: Jan 25, 2006
    Posts: 239
    Hi Andrew,
    Your replies have always helped me a lot.
    what you are seeing as a problem is only because you are trying to develop one application rather than considering from the view that there are two separate applications (client and server).

    That is my key problem.So my task now is to realize exact matching in client using the result of find in server.
    You have to retrieve the records based on the numbers in a separate step.So you would presumably be validating that the records still matched anyway (otherwise the records could change between when you complete the search and when you retrieve the record).

    This is the principle my search must take into account.And the result will be certain object and certain scope be synchronized.
    However I still wonder to know the form how user send their searching infor, what JComponent best suite this requirement.Thanks a lot.
    Carlo Spelgatti
    Greenhorn

    Joined: Mar 06, 2006
    Posts: 10
    Thank you Andrew.

    I was also thinking about this and decided to do the exact matching in the client, but I forgot, that the records I found first could have changed meanwhile.

    regards, carlo


    Carlo Spelgatti<br />Dipl. Informatik Ing. ETH / SCJP / SCJD<br />Ch´┐Żngengass 3<br />8805 Richterswil<br /> <br />P: 044 793 10 50<br />M: 078 698 07 92<br />ICQ: 401810960
    Anna Hays
    Ranch Hand

    Joined: Nov 09, 2003
    Posts: 131
    I didn't do an exact match search on the client. However, I stated that since searching the prefix will return all the exact matches, it satisfy the requirements in the spec of performing an exact match search. My reason is that the user will have a lot to type and have to type careful if you have to type in the exact name and/or location. What do you think about this?

    Thanks.
    Zhixiong Pan
    Ranch Hand

    Joined: Jan 25, 2006
    Posts: 239
    Hi Anna,
    My reason is that the user will have a lot to type and have to type careful if you have to type in the exact name and/or location
    But I think it will not add much complexity, cause only name and location execute exact matching. Why you risk breaking the requirement? Am I right or wrong?
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Exactly match searching in URLYBird
     
    Similar Threads
    NX: Search criteria.
    And/Or search yet again...
    find method in B&S
    NX: Contactor: Query on Search method
    URLyBird: What is "exactly match" in URLyBird?