Java Reference
In-Depth Information
Because it is possible for multiple clients to connect over a network and attempt to mod-
ify the same records simultaneously, the application must be thread-safe. We discuss thread
safety in more detail in Chapter 4. For now, it will suffice to know that thread-safe code pro-
tects an object's state in situations where multiple clients are accessing and modifying the
same object. It is your responsibility to make sure that your certification submission is thread-
safe, as you'll learn in Chapter 4 in the section, “Understanding Thread Safety.”
There is no need to notify clients of nonrepeatable reads— that is, it is not a requirement
that all clients viewing a record that has been modified be notified of the modification. How-
ever, if two employees attempt to rent the same DVD simultaneously, then only one customer
will get the DVD. This is referred to as record locking. In Chapter 4, record locking will be
explored in more detail (with an example given in Chapter 5).
The application should be able to work in a non-networked mode. In this mode, the data-
base and user interface run in the same virtual machine (VM), no networking is performed,
and no sockets should be created. Later, in Chapter 5 (which covers networking), separate
implementations for both RMI and sockets are demonstrated.
Summary
In this chapter, we introduced the public interface of Denny's DVDs rental-tracking program.
We discussed the project requirements and each method of the interface that you will be
responsible for implementing. All of the code for the sample application can be obtained
from the Source Code section of the Apress web site ( http://www.apress.com ).
The new system should be accessible by multiple clients either across a network or
locally. The GUI should be intuitive and easy-to-use, and the application must be thread-safe.
The remainder of this topic examines the requirements covered in this chapter. Denny's DVDs
rental-tracking program will evolve as each new concept is introduced.
FAQs
Q The Sun assignment instructions tell us that we must include the instructions and data
file in our submission. Why is this needed?
A There are multiple assignments available from Sun, and multiple versions of these
assignments. Some of the changes in the assignment versions include variations in the
data file format, the provided interface, the required class names, or any combination
of these variations. Providing both the instructions you implemented and your data file
ensures that the assessor will be comparing your submission with your instructions,
and not anyone else's. Likewise, this means that the assessor is guaranteed to receive
the correct instructions at the same time he or she receives your submission.
Q The provided interface does not include an exception I would like to throw. Can I
add it?
A No. As stated in the instructions, other applications are expecting to use this interface,
so if you add exceptions, the other application will need to catch them. This could
prevent the other application from working.
Search WWH ::




Custom Search