Java Reference
In-Depth Information
Again, we recommend that you read the instructions you received from Sun very carefully
to determine what you need to do about multiple threads receiving notification simultane-
ously (if anything).
Tip We have presented this section on having multiple notification objects as it does appear to meet a
requirement listed in at least some of the Sun instructions. However, at the time of this writing Sun does not
appear to penalize those candidates who ignore this requirement.
Summary
In this chapter we showed how to build classes that can read the data file and provide locking.
We discussed some of the common pitfalls that can occur, and explained how to avoid them.
We also presented several examples of design patterns, and examined how they can be used.
We used many of the techniques that you need to use in your Sun SCJD assignment,
including reading and writing from random locations in files, and locking and releasing
records. We also used many of the new techniques introduced in JDK 1.5, and introduced
some of the new APIs.
One word of caution: As we mentioned in Chapter 3, we have made some parts of our
sample assignment more difficult than the real assignment. You may find far simpler solutions
for your Sun assignment than those presented here (and we strongly recommend you look for
them). Similarly, some portions of the Sun assignment may be more difficult than what we
have presented here. You will also note that there are methods in your Data class you must
implement that we have not even mentioned; we believe we have provided you with the basic
information you need to create these methods on your own.
FAQs
Q Will I have to create my own data file in the Sun SCJD assignment?
A No; at the time of this writing, Sun provides a sample data file for you, along with the
details of the file format necessary for you to read and write the file.
Q Should I provide my test classes and build scripts in my submission?
A We recommend against providing anything outside of the requirements. At the time of
writing, the instructions from Sun include a statement that going beyond the require-
ments will not gain you extra marks. So providing the test classes and build scripts
cannot gain you anything.
Q Should I build the Data class in stages?
A We strongly recommend you do build each of your classes in stages, ensuring that each
part is correct before moving on to the next part.
Search WWH ::




Custom Search