Book Review: Real World Java EE Night Hacks - Dissecting the Business Tier
Figure 1. Real World Java EE Night Hacks—Dissecting the Business Tier
Last week, a great post by AdamBien brought his latest book, Real World Java EE Night Hacks - Dissecting the Business Tier, to mind. I have since gotten myself a copy and thought I’d share my thoughts here.
For starters, this is a very different kind of book. In the foreword, James Gosling describes it this way (and I’ll just quote the whole thing : ) :
Most books for software developers are horizontal slices through some piece of the technological landscape. !“X for Dummies” or “Everything you need to know about X.” !Breadth and lots of toy examples. !This book takes a largely orthogonal approach, taking a vertical slice through a stack of technologies to get something very real done. !Adam takes as his organizing principle one real Java EE application that is not a toy, and goes through it, almost line-by-line explaining what it does, and why. !In many ways, it feels like John Lions’, Lions’ classic Commentary on UNIX 6th Edition.
One of the problems that people often have when they start looking at Java is that they get overwhelmed by the vast expanse of facilities available. !Most of the APIs have the interesting property that the solution to any task tends to be pretty simple. !The complexity is in finding that simple path. !Adam’s book shows a path to a solution for the problem he was trying to solve. !You can treat it as an inspiration to find your own simple path to whatever problem you have at hand, and guidance on how various pieces fit together…
— James Gosling
Rather than telling the user everything he needs to know about Java EE, Adam walks the user through the process of building a real world piece of software in a blow-by-blow account. I think that’s really what makes this shine.
The application is one called x-ray, a "[s]tatistics and analytics Java EE 6 software for blogs (tested with roller) and webapps." As the "domain expert, operator, quality assurance department, architect, tester, and developer all in one person", Adam starts the book by describing the scenario at hand (in a nutshell, gathering blog statistics in real-time without affecting the performance and availability of the blog itself). He does a great job upfront of describing the functional and non-functional requirements so the reader knows where he’s heading. With the high-level details spelled out, he jumps into coding.
One of the things I really liked about the text is that we get to see what works and what doesn’t. At the start of the text (and I’ll let you get the details from the book itself ; ), he tries one approach, finds that it doesn’t work, explains why, then tries another tack, and we get to see it all happen. Sometimes we can learn as much from failure/adversity (ours or someone else’s), so I’m glad he included this part.
After pretty well-documented trial and error in the overall architecture of the software, he finally identifies an approach that should work and beings giving the implementation details. In the process, he shows practical examples of EJB 3.1, REST, CDI, and JPA, all working together. In places where he could use one technology or another (e.g., EJB 3.1 or CDI, or REST vs SOAP), he explains why he chose the one he did, which is a helpful insight for those new to the technology.
By the end of the book, the reader should have a pretty good handle on how the software works, as well as why it was written the way it was. The reader won’t come away with a complete understanding of all of the Java EE technologies used, though, but that’s not the intent of the work. It strikes me as more of an extended mentoring engagement in written form, and I think it does a great job at that.
As a musician (bass guitar, for the curious :), one of the ways I learn to play better is by watching other musicians, listening to them talk about their music, trying to play their lines, etc. The same approach can (and should be) applied in the software world. As best as I can tell, Adam Bien’s is one the most recognized and respected names in the Java EE environment (especially in GlassFish circles), making him a great choice to watch and learn from. Anyone dizzied from the storm of acronyms in the Java EE will be well-served to pick up this book (lots of links to do so here).