Java Reference
In-Depth Information
Your project submission must consist of these components:
•
An executable JAR file, which will run both the stand-alone client and the network-
connected client
•
An executable server-specific JAR file, which will run the networked server
•
A common JAR file, which will contain code common to both client and server
applications:
•
An
src
directory containing the source files for the project
•
The original data file supplied with the instructions
•A
docs
directory that will contain
•
The API generated by Javadoc
•
The end-user documentation
•
The file summarizing your design choices
The entire submission should be packaged in a JAR file, as described in Chapter 9.
■
Note
JARs were initially created to allow applets to be downloaded in a single HTTP request, rather
than multiple round-trips (request-response pairings) to retrieve each applet component, such as class
files, images, and so forth. Executable JAR files have file associations so that clicking on them will run
javaw -jar
on Windows and
java -jar
on Unix.
The Denny's DVDs sample will eventually be bundled into one JAR file. That JAR file will contain an
executable JAR file named
runme.jar
, containing the database files, documentation, and source code.
The
runme.jar
will handle both the server and the client depending on how it is invoked. Running the final
application from the executable JAR file will be explained in Chapter 9.
■
Note
The previous edition of this topic included a chapter on Java's New I/O, or NIO. At the time, NIO
was a new 1.4 topic, and the extent that NIO could be used for the certification exam was unclear. Subse-
quently, after the publication of the first edition and the release of J2SE 1.4, Sun explicitly disallowed the use
of NIO as a networking solution for the certification project, but permitted its use as a mechanism for file I/O.
Admittedly, the main reason for including NIO in the previous edition was just to demonstrate this cool new
technology. Our primary examples (downloadable from the Apress web site) did not use NIO in the network-
ing layer. Unfortunately, there was some confusion since many believed that the inclusion of NIO indicated
that our proposed solution required NIO. It did not. For this reason, we have decided to drop the discussion
of NIO in the current edition of this topic to avoid any further confusion, but would like to make it clear that
sockets or RMI are required for the networking layer but that channels can safely be used for plain old
file I/O.