• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Search Filter methods

 
rinke hoekstra
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(UrlyBird 1.1.1)

Most posts in this forum on the search function are on the interpretation of the "starting with" versus the "exact match" instructions. I will not repeat that, you can do a search if you want to read prior discussions on this.

My conclusion is:
  • Data returns matches starting with...
  • For the gui, these results are filtered back to only exact matches


  • What interests me now, is HOW to do this filtering. Just wondering how people are handling this. You can filter already on the server side or on the client side. And you can filter with an extra table model layer, or directly on the arraylist with rooms.

    What is the most elegant sollution?
     
    Edwin Dalorzo
    Ranch Hand
    Posts: 961
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Well, I still have to fix this particular issue in my design, because I discovered I was not doing it right.

    But it is my impression that implementing an exact search on the server side is the best solution. First, the servers typically have more resources to execute this complex operations, and plus, exact filtering would imply less records have to be sent over the network.

    So, in my case, I think I will implement the two methods, the one suggested by Sun and another one that provides an exact match.

    Since I am using an Adapter Pattern to implement my design I can still locate an extra method like this in the Target interface.
     
    rinke hoekstra
    Ranch Hand
    Posts: 152
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Originally posted by Edwin Dalorzo:

    But it is my impression that implementing an exact search on the server side is the best solution. First, the servers typically have more resources to execute this complex operations, and plus, exact filtering would imply less records have to be sent over the network.


    Thanks Edwin, for your reply

    I'm still in doubt. My first idea was indeed to put it on the server side. Because it feels like a hassle if you have to feed the criteria first at server side to get a list of rooms, and then again feed the criteria at the client side to filter the exact matches.
    However, actually reading your messages makes me doubt



    Why would you want to put it on the server side? To my opinion, network traffic cannot be a serious point. As the search function has an "all" option, it is apparantly not a problem to send all records of the database over the network. Apparantly the database is not so big that we are to expect thousands of records, so this network traffic issue is really peanuts, to my opinion. And as sets are apparantly small, server load is also not an issue.

    For now, I'm tending more towards bringing it to the tableModel level.. But still doubting about what is the best.

    Rinke
     
    Edwin Dalorzo
    Ranch Hand
    Posts: 961
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hmmm! You might be right, Rinke. I will venture another reason. What about responsibility?

    It seems that the server side is already responsible for some filtering, already required by the searchByCriteria method suggested by Sun in the instructions file.

    Therefore, if one needs to implement a new search method, should it not be located in the server side as well? What do you think, mate?

    I know I could reuse the same searchByCriteria method suggested by Sun and then filter it in the client side. That's an option, if you do not consider the network traffic and the additional comparison a performance issue.

    I think that is a viable solution, too.
    [ April 29, 2008: Message edited by: Edwin Dalorzo ]
     
    John Mattman
    Ranch Hand
    Posts: 45
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I think the client logic should be pretty simple by just making the calls to the dao that does all the hard work. I myself provided the second filter method at the serverside.The client can use the either one of those methods based on his/her requirement changes. This is just my opinion.
    Again both kind of designs are pretty good.

    John

    ---------------------
    [ April 30, 2008: Message edited by: John Mattman ]
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic