Java Reference
In-Depth Information
Q Is it necessary/possible for my Data class to use a value object?
A You will have to check your instructions to see whether or not this is possible. All the
instructions to date have been very explicit about the required method signatures for
the Data class. However, even if you cannot use them in the Data class, your instruc-
tions might allow value objects to be used elsewhere in your solution.
Q Is it necessary for my Data class to use the Façade pattern?
A There are no specific patterns that must be used within your submission; you are free
to use any that you feel fit your requirements. Similarly, there are no requirements for
you to acknowledge which patterns you are using, but it is considered good program-
ming practice to mention the patterns in your design decisions documentation and/or
your Javadoc APIs as doing so will assist other programmers in understanding your
code.
Q Should I use a cache in my Sun SCJD assignment?
A Usually the Sun instructions tell you that a clear design is preferred over a higher per-
formance design. So you should decide for yourself whether the addition of a cache
makes your code easier to read, and whether the gains are worth your while.
Q What happens if using a cache causes the JVM/computer to run out of memory?
A You could use lazy loading of records (only loading them when required) in conjunc-
tion with SoftReference s to ensure that the JVM can clear the records if it is running
out of memory. If the JVM does clear the record from memory, using a lazy loading
scheme will result in you reloading it next time you need it (and presumably some
other low-usage object being cleared). That said, you might want to calculate just how
many records it will take to use all the memory on your computer—and whether you
could even access that many records with the provided APIs.
Q Am I allowed to use the java.nio (NIO) packages or the java.util.concurrent pack-
ages in my application?
A In the past Sun has displayed information on its web site indicating that use of the
NIO packages was not allowed for the SCJD assignment. However, Sun has also stated
that the instructions you download from its site are authoritative; if your official
instructions state that you must not use a particular package, then you must not use
it. However, if your instructions do not ban a particular package, then you are free to
use it.
Search WWH ::




Custom Search