There is an interface Sun wants implemented. It has a series of methods with their signatures. Many of these methods read and write directly to the database.
readRec(long recordNumber) is supposed to read a file out of the database. Is this not a waste of time? Shouldn't the server, upon starting, read the whole database into memory? All clients that access the database access the one in memory. Any modifications are done by the server to the database, if successful, then to the database in memory?
It sounds like you are proposing a cache for the data - something that many candidates implement, and it certainly doesnt seem to cause loss of marks.
It has been suggested (from memory by Max Habibi) that a cache could be implied in the instructions - the fact that the read method (amongst others) does not throw InterruptedException would work well with in a cached environment (you can have your constructor populate the cache, and the constructor can throw any Exception you like). That still leaves the problem of the update method but nobody said that everything was going to be easy .
However when implementing a cache you need to consider how many records you can hold in memory / what happens if you run out of memory (this is easily answered, but I am leaving that to you).
Whatever you decide, you need to document your design decisions.
Currently I am working on the B&S Assignment. I currently read all my Contractors in the constructor. I noticed in the Exam Cram book they have a getData method and Max's book has a getDvds(). What are the pros and cons of doing it separately? I guess I thought that since I didn't have a getData method in my interface that I should read all data in in the constructor. That was probably a bad assumption. Thanks, Tom