Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

NX: find method in urlybird

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm confused by what Sun asked me to do:
The user interface must provide exact match search on the City and/or Hotel name. (or all the records if no search information is provided)
The DB interface specifies that the find(String[] criteria) method must provide a starts with search.
(For example, "Fred" matches "Fred" or "Freddy".)
So, my question is : What should I do? or What did you do?
We can't modify the DB interface...
Should I overload the find method in the Data class and have exact search in the new method?
Should I create a class that inherit from the Data class and override the find method? (does not seems like a good idea)
Or simply implement the find method with exact search, ignoring the comment in the DB interface?
Any suggestion would be useful!
 
Bartender
Posts: 1872
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Yanick,


1. Should I overload the find method in the Data class and have exact search in the new method?
2. Should I create a class that inherit from the Data class and override the find method? (does not seems like a good idea)
3. Or simply implement the find method with exact search, ignoring the comment in the DB interface?


Not 3 for sure but 1 looks fine.
Even if the title of this very recent thread (Exception chaining) doesn't match this topic at all , it discusses the search issues with additional links which could help you.
Regards,
Phil.
 
Yanick Labelle
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I think I'm gonna overload the find method as you suggested.
Thanks!
 
You have to be odd to be #1 - Seuss. An odd little ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic