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 questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Bodgitt and Scarper questions" Watch "Bodgitt and Scarper questions" New topic
Author

Bodgitt and Scarper questions

Sudhansu Pati
Ranch Hand

Joined: Sep 23, 2003
Posts: 77
Hi all,
Just wondering if you have noticed the following topics.
Topic 1 : The Background section is as follows
They take requests from home owners for a type of service, and offer the homeowner one or more contractors that can provide the required services.

Does that mean that, we have to allow multi-select in the JTable to select one or more contractors? Anyone has implemented multi-select ?


Topic 2 : Page 3 The User Interface section is as follows
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.
This line is in conflict with the DB interface specified in page 4. The following requirement is for the find() method.
// Returns an array of record numbers that match the specified
// criteria. Field n in the database file is described by
// criteria[n]. 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".)
public int[] find(String[] criteria);


Sudhansu<br />SCJP, SCWCD, SCBCD, SCJD, SCEA, SCDJWS
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11432
    
  85

Hi Suds,
  • Do we have to allow multi-select in the JTable to select one or more contractors?
    I don't think so - the keyword IMHO is offer - in other words, if there are 3 records that match the user's criteria, we have to offer (display) them all to the user - the user can then choose which one they want.
  • The results of searching the database do not match the GUI requirements.
    You did not have a question here.
    Yes, there is a difference in what you should display versus what you get back from your search, but at least you can meet both the requirements of the Data search method, and the requirements of the GUI displaying the results. You can reduce the result set on the GUI side. Had the requirements been reversed (so Data's search returns exact match and GUI required 'starts with' matches) then you would have had a problem.


  • Regards, Andrew


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

    Joined: Nov 27, 2002
    Posts: 451
    Suds,

    Topic 1 : The Background section is as follows
    They take requests from home owners for a type of service, and offer the homeowner one or more contractors that can provide the required services.

    Does that mean that, we have to allow multi-select in the JTable to select one or more contractors? Anyone has implemented multi-select ?

    My assignment said the same thing. It is however just a general statement of the requirements. It does not say that you have make that capability possible in a single user interface gesture. I did not implement multi-selection and scored well.

    Topic 2 : Page 3 The User Interface section is as follows
    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.
    This line is in conflict with the DB interface specified in page 4. The following requirement is for the find() method.
    // Returns an array of record numbers that match the specified
    // criteria. Field n in the database file is described by
    // criteria[n]. 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".)
    public int[] find(String[] criteria);

    It really isn't a conflict as they are just different requirments for 2 distinct parts of the application, the ui and the persistence sections. My solution went a little beyond the ui requiremnts and offered up some of the extra capability present in the persistence section. If you wish to see a more complete description of my design, check the thread, "NX: Notes on a design that passed 389/400".
    Good luck,
    kktec
    SCJP, SCWCD, SCJD


    kktec<br />SCJP, SCWCD, SCJD<br />"What we observe is not nature itself, but nature exposed to our method of questioning." - Werner Heisenberg
    Dave Knipp
    Ranch Hand

    Joined: Oct 14, 2003
    Posts: 146
    Ken and Andrew,
    I had the same question as Suds and was curious why they would have stated it like this. I currently have my search within the gui returning what the find method describes, but found myself questioning this sentence from the instructions.doc
    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.

    So what i understand from both of you is that you should grab the search results from the find method and then filter them again so that the search query EXACTLY matches the contractor's name and/or location. Ken, did you make this EXACTLY match case sensitive? I'm thinking about not making it case sensitive so the user won't have to put in all the upper case letters etc. Let me know if both of you think this is a viable solution.
    Thanks,
    Dave


    SCJP 1.4, SCJD 1.4, SCWCD 1.3, SCBCD 1.3, IBM Certified Solution Developer -WebSphere Studio V5.0
    Bill Robertson
    Ranch Hand

    Joined: Mar 21, 2003
    Posts: 234
    Dave,
    Just a reminder. The instructions, and this is a MUST instruction,
    states:

    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.

    Notice for the name and location search they say EXACTLY. Which would mean
    case sensitive. But your other search could go either way.
    Dave Knipp
    Ranch Hand

    Joined: Oct 14, 2003
    Posts: 146
    Bill,
    That is is a good point, the MUST is really stressed so i guess i should go with enforcing case. Good suggestion.
    Thanks,
    Dave
    Andrew Monkhouse
    author and jackaroo
    Marshal Commander

    Joined: Mar 28, 2003
    Posts: 11432
        
      85

    Hi Dave,
    I had the same question as Suds and was curious why they would have stated it like this.

    Possibly just because they want to simulate a typical specification that you will find in the real world. Which means the specification will have omissions, badly worded sections, and sections that are wrong.
    I'm thinking about not making it case sensitive so the user won't have to put in all the upper case letters etc. Let me know if both of you think this is a viable solution.

    I agree with Bill that you must do an exact match, so it would be case sensitive.
    One thing you might want to consider though, is whether you can offer a drop down list of valid searchable items. That way the user does not have to manually type in selection criteria.
    Regards, Andrew
     
    Don't get me started about those stupid light bulbs.
     
    subject: Bodgitt and Scarper questions