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 Bodgitt and Scarper : Find Method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Bodgitt and Scarper : Find Method" Watch "Bodgitt and Scarper : Find Method" New topic
Author

Bodgitt and Scarper : Find Method

Kevin Broderick
Ranch Hand

Joined: Jul 19, 2009
Posts: 39
Hi all,

Got off to a good start on the Java Developers Bodgitt and Scarper, and indeed I've come up with a general find algorithm. But I have a few questions and I'm hoping that someone who did or doing this project can help.

1) There is an & (ampersand) used for the subcontractor name. I'm using equalsIgnoreCase to compare the criteria to the corresponding record but with the finished application I cannot imaging someone using & and instead saying "and". Should I just make some intelligence on this or is there a better way for comparing?

2)Should the find criteria work on finding the "customer holding this record" field?

Many thanks
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2266
    
    3

Howdy, Kevin. In the name of the JavaRanch family, I'd like to give you a warm welcome!!!

For your first question, I'd say no. Since it is a name, I guess it would be better to just face '&' as '&'.

I'm not sure if I understood your second question. Do you mean, allowing the user to search also for customer ID?... Take a look at your instructions; in my case, I only had to provide full search and search by name and/or location. Most likely, you don't have to provide a search by customer ID.


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Kevin Broderick
Ranch Hand

Joined: Jul 19, 2009
Posts: 39
Thanks Roberto - especially for giving me a warm welcome here on the java ranch.

I will again take a read of the instructions as you said here but I did have a feeling that I was over worrring about searching for the customer ID.

Thanks
Grary Stimon
Ranch Hand

Joined: Sep 30, 2008
Posts: 42
Kevin,

In my B&S 2.2.1 instructions, in the "User Interface" section, it reads:

"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 took this to mean that name and location searching MUST be case-sensitive. I thought I'd warn you of this, in case your instructions are similar.

Also, I created a complete search capability for all criteria, not just for name and location. According to my B&S instructions the user interface is to be developed with the anticipation of future functionality improvements. So, at some later time if searching using more criteria is required, findByCriteria should already have that functionality, I think.

Best,

Grary
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2266
    
    3

Howdy, y'all.

Grary Stimon wrote:I took this to mean that name and location searching MUST be case-sensitive.


Well, not necessarily... some people chose to create a case-sensitive search... I myself created a non-case-sensitive search. As long as you justify your choice, that's a-ok.

I thought I'd warn you of this, in case your instructions are similar.

Grary Stimon wrote:According to my B&S instructions the user interface is to be developed with the anticipation of future functionality improvements. So, at some later time if searching using more criteria is required, findByCriteria should already have that functionality, I think.


Now, this one is a good choice! I also did that!
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5402
    
  13

Hi Kevin,

The find-method in my Data class is a case-insensitive search where the different criteria are OR'ed (so 1 match is enough, a null criterium is ignored) and a startsWith check is executed. You can search on all possible record values (hotel name, location, smoking, customer-id,...), but in my application only hotel name and location are used (for the other ones I did a selective test in my Data class test case).

If the name contains a &, - or ' for example, these symbols should be entered, no artificial intelligence added to translate for example 'and' into '&' (the assignment is difficult enough without it )

Kind regards,
Roel


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Bodgitt and Scarper : Find Method