Books on EJB technology tend to be fairly weighty. There are tomes of over 500
pages that deal solely with the persistence manager. And here we have a slim
(by EJB standards) volume that claims to offer a complete overview in a mere
240-or-so pages including, incredibly, EJB Web Services. Is that possible?
Well, up to a point it is. The trick is to focus ruthlessly on the information
needed to make things work, while skimming over technicalities. The book claims
to provide a `fast-paced tutorial' and that is, I think, exactly the way to
look at it. If you're interested in investigating the possibility of using EJB
in a particular project, and know little about the technology, then this book
would provide a great introduction. It's easy to read, liberally scattered with
code examples, and nicely presented. An experienced Java developer could read
it cover-to-cover in a few hours and understand most of it in one reading.
That's pretty unusual for a book on this subject.
Chapter 1 deals with the EJB architecture (very briefly indeed) and how to
obtain and set up the GlassFish application server.
Chapter 2 is more meaty, covering session beans and EJB clients. It is notable
that Java annotations are used here and throughout the book -- there is little
reference to the earlier ways of doing things. Knowledge of how annotations
work is assumed -- there is no technical explication. Another simplifying
factor is the use of client containers to invoke EJB code. This means that the
author doesn't need to explain in detail how JNDI works, and the reader doesn't
have to try to follow the explanation. But, again, there is a world of detail
here that developers will have to get to grips with at some point.
Chapters 3-5 deal with entities, OR mapping, and the query language. These
subjects are closely related and the chapters really form a single chunk of
material. There's certainly enough detail here to be able to build a
Chapter 6 is a bit of an anomaly. It deals with the entity manager, and is
surprisingly technical compared to the preceeding content. That, in itself, is
not unwelcome -- this is a highly technical area. But since a lot of this
material is relevant to stand-alone persistent applications, and not
specifically to EJBs, I was rather surprised to find this level of detail at
Chapter 7 deals with transations and, again, provides enough information to get
Chapter 8 deals with JMS and message-driven beans (MDBs). Little or no
knowledge is assumed of JMS and, in fact, only about four pages of this chapter
actually deal with MDBs. That's fair enough, I think -- if you have the basics
of JMS under control, MDBs are straightforward enough. But there is only a half
a page on transaction handling in MDBs, which (in my view) isn't enough, even
at an introductory level.
Chatper 9 deals with timer services and is pretty clear.
Chapter 10 deals with interceptors, which are a new feature in EJB3. Again, the
material is straightforward and well illustrated with examples.
Chapter 11 describes Web Services in the EJB world. I have mixed feelings about
this chapter. There's certainly enough information in the chapter that a person
with no experience of Web services could follow the examples. But Web Services
is a massive area of technology, and I'm not sure it's profitable to try to
deal with it in a single chapter. But I'm not sure what the alternative would
be, other than leaving it out. It's not a bad chapter, but I think it will be
very difficult to follow what's going on for people who don't have a background
in Web services.
Chapter 12 is about security, and is pretty straightforward.
I think that this book should appeal to developers who are new to EJB, and just
want to get straight to coding, without reading too much theory. In the long
term, any developer who works with EJB extensively is going to have to
get to grips with the theory, and the inpenetrable EJB Specification, but
a gentle introduction ought to be welcome.
In addition, I would recommend the book to experienced EJB2 developers, who
specifically want a rapid introduction to the new features of EJB3.
In short, this is a good book and I recommend it; but developers shouldn't
get the idea that this is the only thing they'll ever need to read on the
subject of EJB3.