Book Review: EJB 3.1 Cookbook

Being a SOA Architect, it’s been a while since I had to code a Java Enterprise application (a.k.a J2EE  or JEE application) but I am still very interested in maintaining an up to date knowledge of the technical advances in the Java Enterprise platform so that I can fully understand the design implications and the implementation opportunities presented by the platform’s new features.

Enterprise Java Beans 3 (EJB 3) is a major update to the JEE platform which debuts annotation based aspect-oriented configuration and provides new services for entity persistence and new bean types to handle things like timers and scheduling in enterprise applications. This is a new and very efficient approach but it’s very different to the deployment-descriptor based approach of J2EE. There are plenty of EJB tutorials and individual examples on the web, but if you want a fast but still comprehensive coverage I always think you get further with a decent guidebook in hand.

Richard M Reese’s “EJB 3.1 Cookbook” is just such a guide. It’s a quick whistle-stop tour of the EJB 3 platform and covers all the new bean’s and annotations and also covers related hot topics like Web-services using SOAP and REST.

My aspiration in reading this book was to get a quick technical refresher on Enterprise Java Beans and then put this newly obtained knowledge to the test with some additional coding for the my personal SOA reference platform.

Each chapter in the book details a specific part of the EJB technology set. The JEE topics covered by the book include:

  • Session Beans (EJB’s)
  • Message Driven Beans (MDB’s)
  • EJB Persistence (Entity Beans with JPA)
  • EJB Persistence Queries (JPQL)
  • EJB Transactions
  • EJB Security
  • EJB Interceptors
  • EJB Timer Services
  • Web Services (JAX-WS, JAX-RS)

Each topic is split into a selection of individual technical ‘recipes’, each written using a predictable format as follows:

  • “Getting ready” provides an overview of how the recipe works.
  • “How to do it…” provides a full description of how to achieve the recipe’s objectives.
  • “How it works…” explains how any code samples are pulled together and explains any code referenced in the previous section.
  • “See also” identifies any other recipes that may include pertinent information to assist the reader in their understanding.

By following this format the book is astonishingly easy to read. The simple structure means you can plough through it quickly from cover to cover if you want to or you can dip into it for hints when faced with a specific coding challenge.

Usually, code based tutorials and discussions can be a real bind but in using this recipe format Richard has avoided the lengthy code samples that you often see (the ones that usually send me to sleep). Instead he uses a tightly focussed code highlighting technique to illustrate his salient points. It’s an approach that works really well for experienced coders or those like me who are just looking for a refresher. However, novices or those looking for lots of detail may need to look elsewhere because a certain amount of experience with enterprise level coding, application servers, IDE’s, build tools and testing tools is helpful but these topics are not covered in the book.

Overall this book works really well as a technical refresher and really makes it easy to get started with EJB 3.1 (especially if you’re already familiar with some aspects of the JEE platform).

The JEE platform itself has gained some very powerful and useful features and from a SOA implementation perspective, the addition of JAX-WS, JAX-RS and EJB Interceptors into the mix means that JEE is now a great platform for SOA implementing using either SOAP, REST or EJB components.

In conclusion.

I’d definitely recommend this book to anyone who has some experience of Java EE and is interested in the technical advances of EJB 3.1 and the opportunities those new capabilities bring. However, if you’re a novice or you’re looking to get started with EJB for the first time, I’d image you’d be better served by a book that has designed with novices in mind.

Advertisements