This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
No, Sun does not allow anyone to publish a complete solution to a real assignment. You agreed to that when you purchased the assignment.
Books at this level are NOT designed to provide you complete working solutions in easily digestible chunks, they're designed to provide you enough hints and information to figure out what to do on your own. You're in the big league now, out of the sort of education that's provided in highschool classrooms.
Remember that the code in the book are just fragments of code under development. The code you can download is an evolved version of that, of course it will have differences.
Joined: May 27, 2006
That is fair. However, I would have appreciated if there was a disclaimer in the book and code. If there is one, I must�ve missed it.
Jeroen T Wenting
Joined: Apr 21, 2006
Most readers would expect what you encounter, and authors expect readers to expect it.
I disagree when you say "Most readers would expect what you encounter" as I don't believe that when someone buys a technical book (at whatever level) that they automatically expect there to be 'mistakes' in it (or the accompanying code). Of course, sometimes mistakes happen no matter how closely books are proofed but the authors should really ensure that the errata are kept current to avoid any confusion.
Don't misunderstand - i am not having a go as i think the book is very useful (clarifies certain topics and shows another coders approach). The problem i find is that sometimes you can end up wasting time struggling to understand how a piece of code works only to discover that there is a mistake in it and this can be frustrating.
Mohammad points out about the static modifier being absent and as i understand it this is crucial to the thread safety of the application. If there are multiple RAF's and the code synchronises on each individual instance of the RAF then this looks to me like it would not be threadsafe. It is critical that if a piece of code is used to illustrate a point (multithreading), that it does so correctly otherwise it just muddies the waters.
Jeroen T Wenting
Joined: Apr 21, 2006
I wasn't talking about mistakes, I was talking about incomplete samples that don't form a cut and paste recipe for the reader to use as the solution to his own problems but rather are designed to guide his thinking in the right direction.
The source code on publisher website says something and the book says something else
This is to be expected. It is extremely rare for anything to be published without mistakes, and for most books there is an errata page listing the problems. Ours is no exception, and you will find that where mistakes are noted they are included in our published errata page and also included in the README.txt file included in the downloads plus in the source code itself where appropriate. We add to the errata page whenever items are brought to our attention, and now that you have identified some more issues, they will be added as well.
I searched the forum and it seems the authors (most of the time) never address the serious issues of threading, etc.
"threading, etc." covers the entire assignment, so that is a big amount you are suggesting not being covered. The reality is somewhat different - I try not to interfere if there is a discussion already in place, so if somebody has already answered a question I try to avoid just repeating the answer. Otherwise I will answer almost any question - the ones I do tend to avoid is when someone posts 200 lines of GUI code and asks why it is not working. If you look back at my 5000+ posts you will see that I have not avoided threading, or any other topic.
However, I would have appreciated if there was a disclaimer in the book and code. If there is one, I must’ve missed it.
There are several disclaimers in the book, both describing how we have deviated from the real assignment (and why), and describing how the downloaded code may differ from the published code.
Of course, sometimes mistakes happen no matter how closely books are proofed but the authors should really ensure that the errata are kept current to avoid any confusion.
We do try to keep the errata current, and as a result of the posts in this last week I will be updating the errata during the comming week.
How come the database is not defined as static in the DvdFileAccess class of Denny's DVD sample project???
It is defined as private RandomccessFile database = null;
However, it shoudl be static, otherwise the file will be accessed by multiple handles.
Because the DvdFileAccess class is only used by the DvdDatabase class, and is defined as a static member of that class.