I purchase the SCJD assignment just before Xmas last year, and because of work commitments have only just started looking at the problem. Initially I thought I would abstract the RandomAccessFile (database) with a custom DataFile object, which would be a Singleton, therefore preventing threading issues.
This DataFile object would get the fields, magic cookie data, bytes etc from the RAF.
The Data.java would then use a reference to this object to get to the underlying data. My thinking behind this was that it would encapsulate the database file - so that Data.java would have no knowledge of the underlying code, it could in theory just plug into any data source.
Is this a bad design? Is my RAF abstraction object unnecessary? Should the Data.java access the RAF directly? Basically I am trying to encapsulate my database access code, but I am unsure whether application specific data (field lengths, location of delete flags within the RAF) should be known by Data.java or a seperate DataFile object?
posted 10 years ago
IMHO, you can add a lot of stuff you want.. But its better to stick with the Sun's bare requirements.
I did lot of unwanted things mostly on the client side like MDI windows, Delete operation, checkout, update.. I ended up with almost 20 classes/interfaces.
Now when I think the examiner is not only going to look at the end product (the working software) but also the tons of code, it gives me creeps..
Better not to do more than what is required, as far is SCJD is concerned.. In real world its different...