Hi Keith,
I would strongly suggest and recommend that you read the book "Head First Design Patterns"
by Eric and Elisabeth Freeman and take a look at the Singleton, Factory, Facade and Adapter
patterns.
Not sure if you already got your assignment instructions from Sun-Oracle but keep in mind that
in the Monkhouse book like in the SCJD assignment we are given an interface to be implemented by
a Data class.
In Denny's DVDs you have the DvdDatabase class that implements DBClient is a facade and an adapter.
Using composition this facade has a DvdFileAccess and a ReservationsManager.
To make the DvdDatabase class
thread safe the authors chose to use a synchronized block when they seek()
and read()/write() to/from the RandomAccessFile and they are also choosing to use the java.util.concurrent API
which in my view is more complex at the time of extend functionality and maintain the code by a junior developer.
The authors did that on purpose.
Yes, the Data class implementing the interface provided by Sun needs to support requests from multiple clients.
How you implement it and solve it it's up to you as long as you justify it clearly why you decided your design choices
in choices.txt.
I did make my Data class a Singleton with synchronized public methods because in my view it is the simplest and easiest
approach and the easiest for a junior developer to extend and maintain as compared to the java.util.concurrent API.
HTH,
Carlos.