Java Reference
In-Depth Information
Figure 9-1. Denny's DVDs 2.0 overview
The design decisions we made centered around the three tiers of the application, which
are central to the SCJD exam. The areas of interest are locking in the db package, choosing
between RMI and sockets for the network layer, and using the MVC pattern in the GUI package.
We also need to cover how to package, install, run, and test the application.
You can find all of the sample code in the Source Code section of the Apress web site
( http://www.apress.com ). This chapter explains how to compile and package the final version,
Denny's DVDs 2.0.
Let's get started!
Thread Safety and Locking
Thread safety was covered in depth in Chapter 4. The main thrust of Chapter 4 was to explain
threading and related topics such as synchronization, locking, and concurrency and the new
concurrent package of JDK 5. Waiting was also explained in detail, as were other issues relating
to sharing a single resource across multiple client threads.
Chapter 5 also implemented a locking strategy that demonstrated these concepts. For
example, the networking code base creates separate instances of the DvdDatabase class for
each client so that we can identify the owner of the lock as described in the discussion points.
The Choice Between RMI and Sockets
It can be difficult to choose whether to develop an RMI solution or a serialized object over
sockets solution to the Sun SCJD assignment. Sun will accept either solution, with no extra
marks awarded or deducted for the choice alone. Many candidates simply choose the technol-
ogy they are least familiar with as that gives them greatest scope for learning. But if you do not
know either technology, or if you are equally comfortable with both technologies, it is benefi-
cial to be able to look at the benefits of each.
Search WWH ::




Custom Search