Robust Java by Stephen Stelting

I came across this book when I was trying to compose my next Amazon shipment of books. It caught my eye because I have not read much literature or talked to many people about exception handling best practices. It is certainly a topic that was never taught at University in great depth and something I find tends to be neglected in the workplace.

My initial impressions of the book after reading the foreward and first few chapters is that it is a very well written and a well published book. The author sets the expectations of his readers early with what he is trying to achieve and manages to accomplish his goals in the rest of the book. The format is well laid out and the excellent quality of the editoral work is evident by the ease of reading attained without the interruptions typically caused by poor spell checking or grammatical errors.

The first few chapters discuss the basics of exceptions and the different options (both simple and advanced) for handling such exceptions. Unlike many other books, this one goes into great detail about exceptions and the different options for handling them, covering topics such chaining, subclassing, internationalisation, the components of a stack trace, and exception handling in a multi-threaded system. The author also details exceptions that commonly arise when working in specific parts of Java (e.g. IO, RMI, JNDI, J2EE) noting that J2ME has been excluded (which I assume the author has not had much experience with or does not deem significant enough to mention).

The book captures a number of exception handling best practices, when to apply each of them, and the consequences of selecting one over another. Each strategy is backed up by both academic and practical reasons, adding even greater substance to his arguments. I was also impressed with the quality of the code examples, as it was either selected from a project the author was involved with, or was pulled directly from the JDK. I found that these selection criteria added both the realistic and relevant aspects to the book that many other authors tend to neglect.

Though I have a few criticisms of the book, I do not want to overly emphasise them as I believe the book, as a whole, provides a significant amount of value. It provides even more value to readers who might not yet have developed their own opinions or want to find out more about someone else’s in their area. And now with that disclaimer…

Firstly I think that the more appropriate title for this book, instead of “Robust Java: Exception Handling, Testing and Debugging”, is “Exceptionally Robust Java: Handling, Testing and Debugging”. My expectation of this book going into great depths of three, typically neglected, areas (Exception Handling, Testing and Debugging) was dashed upon reading the table of contents. A single chapter for each testing and debugging that seemed to be thrown in at the last moment provided little value to me in the overall context of the book. Perhaps they were included for audiences newer to these concepts to which I would respond does not really correspond to the value that is emphasised by the full title of the book.

I also think that the author could have gone into greater detail about some of the exception handling options and consequences of a few particular ones. For example, I have seen that the use of a Custom Exception can lead to a very bad smelling ‘Bloated Hierarchy of Excessively Fine Grained Exceptions’. Another example that could have been given for better managing the granularity of exceptions is the Custom Exception with an Error Code embedded in it.

2 Replies to “Robust Java by Stephen Stelting”

  1. Thanks for writing this review. Given the huge numbers of books available, it really helps to be able to read other’s reviews.

  2. No worries. I know how hard it can be to find a good book to buy (and way too easy to buy a dud). It’s definitely made much easier when someone you know has read it as well.

Comments are closed.