Book review: EJB 3.1 Cookbook

Z Jacek Laskowski - Wiki Projektanta Java EE

Grafika:bookcover-ejb31cookbook.png EJB 3.1 Cookbook by Richard M. Reese (Packt, June 2011)

Too basic, often repetitive and thus boring - 400 pages yet 100 would make it a better reading

In short, "EJB 3.1 Cookbook" by Richard M. Reese did not live up to my expectations. Any, at all. I found some interesting bits (esp. "Using interceptors with timers" in Chapter 9 and "Creating your own interceptor" in Chapter 12), however they don't merit reading the entire book as the time it took was not worth it. My biggest gripe is that the book's often too basic, focusing on irrelevant things, and trying to follow a fixed structure of recipes often repeats itself, and thus boring. It's tempting to skim over the pages or get sidetracked. It's by no means engaging.

The book is a compilation of, what the author called, recipes. All the receipts meant to create a cookbook, and while they were "simple", they weren't "incredibly effective", quoting from the book's front cover.

I assume cookbooks are meant like this - they provide recipes, and while you may find out how to achieve a goal, you won't find out whether it's the most effective or appropriate in a given scenario. You find no answers on why it's done that way or why it was possible at all.

According to "Who this book is written for" (see the book's website or the closing cover) "the book is aimed at Java EE and EJB developers and programmers." I could hardly disagree with that general and vague description - it says nothing about their experience that I believe is crucial for this book to shape expectations before giving the book a go.

I don't think it aims at people who are just starting their journey into EJB 3.1 and/or Java EE 6 as there's too much loosely placed explanations of different approaches and one has to be very careful not to follow the recipes in their entirety.

On the other hand, I doubt that it aims at developers who have already spent some time with EJB 3.1 (where I belong to), either - it's too basic and clattered with servlets as the way to showcase the EJB 3.1. There's, however, no recipe with EJB beans bundled in a WAR. That would greatly have eased a few recipes and, moreover, ditch a couple of pages. I'd rather avoid using servlets for every sample, especially where there's more servlet/HTML code than EJB one. It's not uncommon.

I'm thus troubled to clearly point out who the book is really aimed at. Many pages cover basic Java programming material (it's clearly visible in chapter 12 "EJB Techniques" where java.util.Date/Calendar, java.util.logging and String manipulation are presented, or when @Override on page 10 is explained), whereas there are pages with more advanced EJB 3.1 concepts - timers, transaction, security or interceptors. Glancing at the table of contents it's easy to get deceived into thinking the book will cover a lot of advanced stuff, but it doesn't take long to realize that the table of contents looks promising, while the material covered is not as intensive as it may have been considered.

The book uses NetBeans 6.9.1 and GlassFish 3.0.1, but they're almost invisible as the topics don't touch too many container- or IDE-specific aspects. Just a few pages should not spoil the book for readers who use other tools (provided the other shortcomings did not already).

Unfortunately, it's easy to find a typo in the text or the code snippets. The editing process leaves much to complain about.

Sentences like "Mozilla Firefox or Google Chrome can be used to display the output of servlets" (page 3), "Message sent successfully", "Message sent successfully2" (page 21), or explanation of how the jar tool works (in chapter 11, pp. 345-351) are, say, how the book is written - there are 400 pages yet 100 would make it a better reading.

Osobiste