Developing Java Software
Simon P. Chappell writes "It's good to learn a programming language, but it's a far better thing to learn to write programs in that language. What the world needs are less programming language books and more books on programming with the language of your choice. Enter Developing Java Software, 3rd edition by Russel Winder and Graham Roberts. Dr. Winder is the primary author and I became aware of this book when he mentioned it on the Groovy mailing list. Knowing him to be an intelligent and helpful member of the Groovy development team, I rushed to suggest that I could review it for him." Read the rest of Simon's review.
Developing Java Software (3rd edition)
author
Winder and Roberts
pages
885 (19 page index)
publisher
Wiley
rating
7/10
reviewer
Simon P. Chappell
ISBN
0470090251
summary
A good book for learning to write programs with Java.
Developing Java Software is a text book, and is targeted towards university undergraduates, most likely in some form of computer science curriculum. It is also completely suitable for self-learners who want to teach themselves how to write software in Java. The book has been used by the authors when teaching undergraduate classes at University College London, so it has been fully tested in the academic environment.
There are five parts, with twenty four chapters between the first four parts and ten appendixes in the fifth. Each of the chapters are short, most are less than 40 pages, tightly focused and fairly self-contained.
The first part, the longest of them all, starts out with the introduction chapter that no book is complete without. Really, how many people who want to learn Java don't know that it used to be called Oak and was originally designed for set-top boxes? Anyway, after that little excursion, the book moves onto useful stuff like "Programming Fundamentals", introducing concepts like statements, variables and expressions. Next is "Adding Structure" where we discover methods and control structures. Chapter four is "Introducing Containers" and does a good job of covering arrays and the whole slew of container data structure classes in the standard library. Chapter five is a little time off for good behaviour, where we get to spend some time "Drawing Pictures" before heading into chapter six for "Classes and Objects". Chapter seven explains "Class Relationships" while chapter eight introduces us to "Exceptions". Chapter nine is "Introducing Concurrency with Threads". We finish up with chapter ten covering "User Interfaces".
Part two addresses the "Process of Programming" and this is where it really differentiates itself from the rest of the Java book crowd. Chapter eleven gives an overview of "The Programming Process". Chapter twelve begins the process of making that real by addressing "Unit Testing". Chapter thirteen continues the story with "Test-driven Programming Strategies". More practical advice comes in chapter fourteen as they introduce the reader to "Programming Tools".
Part three brings two "Case Studies in Developing Programs". Chapter fifteen introduces the case studies. The first study, "Contacts Book" is in chapter sixteen and the second, a "Pedestrian Crossing Simulation" is in chapter seventeen.
Part four is "The Java Programming Language in Detail". This is the more reference portion of the book and it's seven chapters cover variables, types and expressions, flow-control, classes and packages, inheritance and interfaces, exception handling, threads and concurrency.
Part five is the "Endmatter" and holds ten appendixes.
The first thing to like with this book is that it has an engaging style. The style comes not just from the body text, but also from the notes, tips and references in the margins of the book. As someone who learned Java almost ten years ago, I have difficulty plowing through yet more body text explaining the same old stuff that every other Java book covers; yet, jaded and cynical as I am, I enjoyed the sparks of honesty and humour in the text.
As I alluded to in my opening remarks, this book takes the approach of trying to not only teach Java, but how to approach and actually write programs using Java. The book takes an iterative approach and emphasizes the use of testing tools. Interestingly, they use TestNG rather than the de facto standard JUnit. This is the first book that I've seen that uses TestNG; perhaps JUnit is finally getting some competition?
The book is completely targeted at Java 5. All of the code examples use the new features where appropriate. This makes the book worth considering for those that already know Java but want to finally climb onboard with the latest version.
Naturally, there is a website available at www.devjavasoft.org where all of the source code for the programs in the book may be downloaded, together with answers to the exercises and any updates or revisions of the material in the book.
One of the challenges of writing or updating a book of this size is that it's possible (nay, almost guaranteed) to miss important things. The tip at the top of page 190 is a classic example, where the reader is advised that calling System.gc() will force the Java Virtual Machine (JVM) to perform a garbage collection. This is not, and has never been, true. The most that the System.gc() call will do is let the JVM know that now would be a good time for it to garbage collect, but there are no guarantees that any collection will actually take place. With this being the third edition of the book, I expected errors of this sort to have been caught by now.
Another point to consider is that with this being a textbook the writing style is less like a mass-market book and it also includes questions and exercises at the end of each chapter. I normally avoid books of this sort, although this does seem to be one of the better ones.
I hate being picky about typography, especially with the average level being quite good these days, but this book is set in a smallish font for the amount of text on each page. It is a serif font, but I didn't find it the most comfortable to read. Also, and this is the most egregious fault in the whole book, the program listings are set in a proportional font! I could hardly believe it when I saw it. While I realize that the authors are unlikely to be responsible for the final font selections, I fear that it damages an otherwise strong book and does them a disservice.
This is a good book for learning Java. More importantly, it's a good book for learning to write programs with Java.
You can purchase Developing Java Software 3rd edition from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Developing Java Software is a text book, and is targeted towards university undergraduates, most likely in some form of computer science curriculum. It is also completely suitable for self-learners who want to teach themselves how to write software in Java. The book has been used by the authors when teaching undergraduate classes at University College London, so it has been fully tested in the academic environment.
There are five parts, with twenty four chapters between the first four parts and ten appendixes in the fifth. Each of the chapters are short, most are less than 40 pages, tightly focused and fairly self-contained.
The first part, the longest of them all, starts out with the introduction chapter that no book is complete without. Really, how many people who want to learn Java don't know that it used to be called Oak and was originally designed for set-top boxes? Anyway, after that little excursion, the book moves onto useful stuff like "Programming Fundamentals", introducing concepts like statements, variables and expressions. Next is "Adding Structure" where we discover methods and control structures. Chapter four is "Introducing Containers" and does a good job of covering arrays and the whole slew of container data structure classes in the standard library. Chapter five is a little time off for good behaviour, where we get to spend some time "Drawing Pictures" before heading into chapter six for "Classes and Objects". Chapter seven explains "Class Relationships" while chapter eight introduces us to "Exceptions". Chapter nine is "Introducing Concurrency with Threads". We finish up with chapter ten covering "User Interfaces".
Part two addresses the "Process of Programming" and this is where it really differentiates itself from the rest of the Java book crowd. Chapter eleven gives an overview of "The Programming Process". Chapter twelve begins the process of making that real by addressing "Unit Testing". Chapter thirteen continues the story with "Test-driven Programming Strategies". More practical advice comes in chapter fourteen as they introduce the reader to "Programming Tools".
Part three brings two "Case Studies in Developing Programs". Chapter fifteen introduces the case studies. The first study, "Contacts Book" is in chapter sixteen and the second, a "Pedestrian Crossing Simulation" is in chapter seventeen.
Part four is "The Java Programming Language in Detail". This is the more reference portion of the book and it's seven chapters cover variables, types and expressions, flow-control, classes and packages, inheritance and interfaces, exception handling, threads and concurrency.
Part five is the "Endmatter" and holds ten appendixes.
The first thing to like with this book is that it has an engaging style. The style comes not just from the body text, but also from the notes, tips and references in the margins of the book. As someone who learned Java almost ten years ago, I have difficulty plowing through yet more body text explaining the same old stuff that every other Java book covers; yet, jaded and cynical as I am, I enjoyed the sparks of honesty and humour in the text.
As I alluded to in my opening remarks, this book takes the approach of trying to not only teach Java, but how to approach and actually write programs using Java. The book takes an iterative approach and emphasizes the use of testing tools. Interestingly, they use TestNG rather than the de facto standard JUnit. This is the first book that I've seen that uses TestNG; perhaps JUnit is finally getting some competition?
The book is completely targeted at Java 5. All of the code examples use the new features where appropriate. This makes the book worth considering for those that already know Java but want to finally climb onboard with the latest version.
Naturally, there is a website available at www.devjavasoft.org where all of the source code for the programs in the book may be downloaded, together with answers to the exercises and any updates or revisions of the material in the book.
One of the challenges of writing or updating a book of this size is that it's possible (nay, almost guaranteed) to miss important things. The tip at the top of page 190 is a classic example, where the reader is advised that calling System.gc() will force the Java Virtual Machine (JVM) to perform a garbage collection. This is not, and has never been, true. The most that the System.gc() call will do is let the JVM know that now would be a good time for it to garbage collect, but there are no guarantees that any collection will actually take place. With this being the third edition of the book, I expected errors of this sort to have been caught by now.
Another point to consider is that with this being a textbook the writing style is less like a mass-market book and it also includes questions and exercises at the end of each chapter. I normally avoid books of this sort, although this does seem to be one of the better ones.
I hate being picky about typography, especially with the average level being quite good these days, but this book is set in a smallish font for the amount of text on each page. It is a serif font, but I didn't find it the most comfortable to read. Also, and this is the most egregious fault in the whole book, the program listings are set in a proportional font! I could hardly believe it when I saw it. While I realize that the authors are unlikely to be responsible for the final font selections, I fear that it damages an otherwise strong book and does them a disservice.
This is a good book for learning Java. More importantly, it's a good book for learning to write programs with Java.
You can purchase Developing Java Software 3rd edition from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
I think after checking this out more on Amazon.com I am going to pass on this particular book. Not only is it $65... $15 more than usual Wrox books (which I personally like) but it also seems to have a lot of condensed information with potentially useless programming situations... I find it hard to believe that the reviewer did not find much wrong with the book and only gave it an 7/10? If we convert that into a grading scale, obviously thats 70%... thats struggling to get points across, and will be adequate for basic points ofr JAVA 5. As a suggestion, I would love to see a review of a good JAVA 6 book, so I know what others have checked out, so I can make an educated decision on what my nice shiney new JAVA 6 book will be.
-- Josh
"Whoopie! Man, that may have been a small one for Neil, but that's a long one for me!" - Pete Conrad
...is Bruce Eckel's Thinking in Java which has already invented the idea displayed here. Thats why you'll see that this book (tij) doesn't fully go into the bare Jave code but mostly reflects on the things which really matter. Knowing what things like Objects are, why objects differ from primitives, etc. Being a Java enthousiast myself it still amazes me how many people "program in Java" yet never learned how to interpret the JDK documentation, especially the so called API documentation.
Anyway, the Thinking in Java book is both available for free download (see URL above) and if you wish a hardcopy (or the latest release) then you can also purchase it. In my opinion this is a much better book which is also presented in a more fair way.
Any Java book that starts with explaining statements, control structures etc. without first explaining what an object and a class is, does not sound very promising. In the CS educators community there is a movement towards an 'objects-first' approach in teaching JAVA, or more precisily, OOP using JAVA. Any book that typically starts with a 'hello world' program completely misses the point. First teach what an object is, what a class is, only then say something about how you can make these objects work together. This seems to be a much more fruitful approach in teaching students how to think OO, and then to put their ideas into any programming language, which happens to be JAVA in many cases. For a very good book to use in a programming 101 class, see 'Objects First With Java' by Barnes&Kolling (Prentice Hall; 3rd edition; June 2006)
Which you can't, because like half of java.lang, Integer is final, which means no other classes may extend it. Because, of course, no one would EVER want to add new attributes to Strings. (Like, say, font information, color info, minor things like that.)
My current favorite Java programming book is Java Concurrency in Practice by Broan Goetz and others. It's not for beginners, but if you really want to understand how to write multi-threaded code in Java you need to read this book. Several times, probably, because it's a tricky subject.
Other books I like for Java are Effective Java (though he needs to update it for Java 1.5) and Java Puzzlers.
I don't know of any books that are good descriptions of the Java 1.5 features for experienced programmers. Some people like Thinking in Java, but it seems pretty wordy to me. I originally learned Java from Java in a Nutshell but it's been something like 8 years, so I don't know if the newer editions are any good.
Disclaimer: some of the authors of these books are my co-workers, though I don't know them very well.
First of all, String and the primitive wrapper classes are used by most of the core classes like ClassLoader and Class. If they could be overridden, it would be a gigantic security hole. Also, many crucial mechanisms rely on those classes' immutability, so allowing for the possibility of a mutable subclass would introduce considerable instability.
Second of all, people all too frequently seem to want to use inheritance for every task. Inheritance is not a toy. It's a String and some other data, not a new kind of String or a String with specialized behavior. Subclass when you must, not whenever you can. As someone else pointed out, you're far better off using a class (such as java.text.AttributedString) that aggregates a String and your other attributes of interest.
The Internet is full. Go away.
(note that this doesn't apply to C# programs written with Visual studio, I'm not sure why C# runs under a VM considering that it was designed for Windows only)
.NET developers don't need to worry about switching between 32 or 64-bit systems.
It allows the same binaries to run on Windows on different processors -
Java may not perform quite as fast as C/C++, but the difference is neglible, and is only noticable in applications requiring alot of processing.
Actually, it can be the other way around. The more processing, the more chance that the run-time profiling and optimising gets to work, the faster Java runs.
Java programs are however slower to start, since they require that the JVM be started and the JIT compilation to be performed.
The JVM starts fast, and modern Java does not require any JIT compilation before the program starts. Instead the interpreter starts running, and hotspot optimisation kicks in later.
The Swing toolkit, IMO, does a huge disfavor to Java in this regard. Because the entire toolkit is emulated, making the GUI slow, contributing to the general perception of Java as slow.
Was true years and years ago, not now. It isn't all emulated - Swing uses DirectX to write to displays on Windows, for example. I am not actually sure that 'emulated' is meaningful. Swing draws controls using the Windows graphics API. So does every other Windows app. These days, having custom controls is very common (just look at media players).
I much prefer the SWT toolkit, since it both integrates better with the native environment and performs better.
Not true any more either. SWT has a reputation for actually being slower than Swing on at least some platforms, such as X. (Anyway, what does 'native GUI' mean on X-Windows anyway?)
In fact most people wouldn't be able to tell a Java SWT app apart from a C/C++ GTK/Windows/Mac application.
With Java 6, the same is true for Swing - a lot of work has been put into that, especially with the Vista interface.