This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
In the GUI for the B&S assignment, did you allow your users to search for contractors that cost less than, and size more than etc??
these searching features are not required by the assignment, that is to say, they don't take away your points if you don't implement them. However you can implement them if you want to. But watch out, the complexity of your project would increase, errors would be more likely to appear.
Recognizing that there appear to be different versions of the B&S assignment, I wonder if the reply statement "these searching features are not required by the assignment" would actually apply in my case? In the Background section of the assignment, it says (using "must"), "The new application, using the existing data file format, must allow the CSRs to generate a list of constractors [sic] that match a customer's criteria. This is the project that you have been commissioned to implement."
True enough, later on in the specification, in "The User Interface" section, the only search criteria actually mentioned are search for all records or "for records where the name and/or location fields exactly match values specified by the user".
However, I have been inclined to interpret the earlier "must" statement in the Background section as meaning that I have to provide search capabilities based on such criteria as types of work performed and hourly charge, both of which seem reasonably to be "a customer's criteria". Do you think I'm reading too much into the Background statement and making things unnecessarily hard on myself?
Jim Coble<br />SCJP 1.4<br />SCWCD 1.4
Joined: Sep 17, 2002
Originally posted by Jim Coble: Do you think I'm reading too much into the Background statement and making things unnecessarily hard on myself?
No I don't think you are reading too much into the background statement too much, your concern is very reasonable in a real project, and, in fact neccessary IMHO. However, I would prefer to realise this is an exam assignment, it's not a bad idea to surmise what kind of skill of you the examers want to test. Now my understanding to the instructions is (I got the B&S assignment too, by the way), they do not want to see what fancy db operations you could write, but they do want to test if you have enough skill to write code which can perform the tasks below:
get input strings from user on the GUI
verify the format of input if neccessary
send the inputted strings back to business layer to perform further operations. An alternative at this point is, you could send the strings directly to db layer...depends on the architecture of your design.
find out all the records which meets the criteria at the backend
send the matching records to the frondend, format it nicely if neccessary (usually in a JTable).
Inplementing more db searching options is not necessarily harder, the statements could be pretty similar for different methods. But you do have more code to write, and make sure they are all valid.
Joined: Oct 27, 2002
Upon re-reading the specification for my assignment, I found something else that further supports Ellen's opinion that it is not necessary (at least in my version of the assignment) to implement search options other than those explicitly named in the specification. The interface that I am required to implement includes only one find method, which takes a string array of "criteria". The comment preceding the method declaration includes the notation that "A non-null value in criteria[n] matches any field value that begins with criteria[n]." That is a fairly specific indication of the kinds of searches that that particular find method is expected to support, which would not include "costs less than" or "types of work includes" (though it does, however, allow for the types of searches explicitly mentioned in the specification).
Of course, I guess I could add methods to the implementing class that are not included in the interface (as long as I do implement all the interface methods) but this seems to me one further indication that I don't need to bother with that.
Now, I just need to figure out if I should worry about a possible discrepancy between a find method that functions essentially like a "starts with" and a user interface requirement for a search "where the name and/or location fields exactly match values specified by the user."
Originally posted by Jim Coble: Now, I just need to figure out if I should worry about a possible discrepancy between a find method that functions essentially like a "starts with" and a user interface requirement for a search "where the name and/or location fields exactly match values specified by the user."
If you notice, the "starts with" is in the server portion and the "exact match" is in the GUI. The data interface should return a more general and flexible search and then it is up to the GUI layer to take those search results and filter out the ones that are exact matches. Hope that helps.