When it comes to J2EE (Java 2 Platform, Enterprise Edition), you don't know a hill of Enterprise JavaBeans (EJBs). Don't worry, you'll find plenty of reading material to give you a hand. In fact, you may find too much! I'm here to help you narrow the choices to a single book you can carry from the bookstore without getting a hernia.
J2EE is a multifarious collection of server-side technologies that together forms the basis of powerful enterprise applications. I won't bore you with yet another J2EE overview; chances are you've already read one or more. On top of that, any one of the four J2EE books I review here will give you such an overview.
In this article, I review the following four J2EE books:
- CodeNotes for J2EE: EJB, JDBC, JSP, and Servlets, Robert McGovern and Stuart Charlton, edited by Gregory Brill (Random House, 2002; ISBN: 0812991907)
- Java for the Web with Servlets, JSP, and EJB, Budi Kurniawan (New Riders Publishing, 2002; ISBN: 073571195X)
- Professional Java Server Programming, J2EE 1.3 Edition, Cedric Beust et al. (Wrox Press, 2001; ISBN: 1861005377)
- Sams Teach Yourself J2EE in 21 Days, Martin Bond, Dan Haywood, Debbie Law, Andy Longshaw, and Peter Roxburgh (Sams, 2002; ISBN: 0672323842)
Beyond each book's merits, I also delve into their bonus resources such as Websites or CDs. Finally, I summarize my comparisons and give you a definitive answer regarding which is the best.
When I read a book review, especially a comparative book review, I want unequivocal answers. For this review, then, I answer the question, "On my four-day backpacking trip in the Emigrant Wilderness next week, which one book will I bring?"
* Not explicitly stated; I inferred this from the fact that he covers Servlet 2.3, JSP 1.2, and EJB 2.0.
CodeNotes for J2EE: EJB, JDBC, JSP, and Servlets
At 222 pages, CodeNotes for J2EE: EJB, JDBC, JSP, and Servlets runs considerably shorter than its brethren (or did you think that was a typo?). The CodeNotes series strives to teach any technical subject in fewer than 200 pages—a laudable concept.
While I favored CodeNotes for J2EE: EJB, JDBC, JSP, and Servlets from the start, I was chagrined to learn how the writing team achieved some of the sleekness: They periodically relegate various subjects to the CodeNotes Website (the book does not include a CD).
I consider that somewhat of a cheat, but in practice I didn't find it that painful. Moreover, I could discriminate a little more about what I needed to read. Normally when I read a book, I read through unnecessary parts, unless they are really long and clearly irrelevant. In this case, if a particular reference is not pertinent, I won't bother to read it on the Website.
Unfortunately, when I did want to look up a subject on the CodeNotes Website, I found the site slow and unreliable. The last several times I tried to access it, I received a "Could not connect to JRun Server" message—not a stimulating application of J2EE technologies. Let's give them the benefit of the doubt and chalk it up to a hardware problem; hopefully by the time you read this, the site is back online.
As for the book itself, ironically, the authors spend too much time (or too many pages, as it were) on subjects best relegated to the Website. In particular, the introductory JDBC (Java Database Connectivity) material seems altogether unnecessary, as numerous other books cover JDBC alone.
CodeNotes for J2EE: EJB, JDBC, JSP, and Servlets has a sparse index, and the table of contents' vague headings—such as "Neat Tricks" and "Core Concepts"—didn't help me find specific topics. If I didn't know for sure the book covered a particular topic, I would have assumed the book didn't cover it and given up.
CodeNotes for J2EE: EJB, JDBC, JSP, and Servlets's small size proves handy for learning on the go, reading a page or two while waiting at the dentist or while sipping a double shot, no-whip, nonfat mocha Valencia at the local coffee shop. The book's biggest problem: it simply is not up to date with J2EE 1.3. The book covers J2EE 1.2.1, but has not (yet) been updated. For example, the book mentions message-driven beans as a coming feature, but does not explain further.
To sum up
Despite all my griping, I did like CodeNotes for J2EE, generally speaking. I like a book that zips through the material and doesn't blather on or repeat points made earlier. Indeed, I wish more publishers would favor this style. So, CodeNotes folks, please quit wasting time writing .Net material and update your J2EE book!
Java for the Web with Servlets, JSP, and EJB
I found Java for the Web with Servlets, JSP, and EJB a generally lucid, mostly well-written text, but it is not without the occasional literary hiccup.
Budi Kurniawan takes a pragmatic approach to solving a few specific problems, such as programmable file downloading (file downloading with authentication) and file uploading, an online e-book, and a simple shopping cart example. Some of these examples seem a bit rough on the edges, though. For instance, the "XML-Based E-Book," example seems a bit unconvincing. While Kurniawan extols the e-book's advantages over paper-based books, he belies his argument by not having published any material in the e-book format. Examining the e-book project reveals the reasons: he designed it such that each topic is a separate HTML file and the contents tree is an XML file. Managing a book in that form would be an absolute nightmare. In spite of that, the e-book represents a starting point that could be refined into something more manageable (left, naturally, as an exercise for the reader).
out.println("<br>"); lines in some servlet examples would slim this book down by more than 20 percent.
Java for the Web with Servlets, JSP, and EJB includes a CD whose sparsely populated code samples surely would be better posted on a Website. Perhaps the CD increases the book's perceived value, giving it a little edge over CD-less books on the bookstore shelf? The CD contains Kurniawan's file upload and download beans, but he fails to include their Javadocs.
Strangely, the CD's code listings reside in chapter-section.txt-named text files that you'd have to rename to be of any use. For example, you'd have to copy and rename the first code example, named
TestingServlet.java before you could use it.
Neither the New Riders site nor the BrainySoftware site includes any information not also found in the book or the CD.
To sum up
Professional Java Server Programming
Going into this review, I must concede my initial bias against the gang-of-thirteen Professional Java Server Programming. I thought so many cooks would produce a scattered and disorganized menu. I am pleased to report, however, that my bias proved wrong. Maybe a large and diverse subject like J2EE lends itself to gang writing? Professional Java Server Programming both broadly and deeply covers J2EE (not surprising, since it has the most pages and smallest print of the four I reviewed).
Professional Java Server Programming thoroughly covers JNDI (Java Naming and Directory Interface), various aspects of servlets, JSP and tag libraries, JavaMail, the various EJB types, JMS (Java Message Service), J2EE Connector Architecture (JCA), Web services, and deployment.
On the down side, I must mention the book's two physical shortcomings: First, with numerous attractive book covers offered by publishers such as Manning, New Riders, and O'Reilly & Associates, you'd think Wrox Press could produce a cover more interesting than a collage of 13 nerds. What were they thinking? Additionally, on a slightly less tongue-in-cheek note, the book's low-quality binding resulted in pages coming loose and fluttering out (and no, this was not because I tried to tear the cover off!).
While Professional Java Server Programming doesn't include a CD, its Website includes downloadable source code and a thankfully short errata list. I had some trouble locating the book's Website (you can use the handy link below). The book itself refers you to the Wrox Press homepage; once there, searching by ISBN 1861005377 will save you the most trouble.
To sum up
Professional Java Server Programming thoroughly covers J2EE. You'll find it a good desktop reference and a solid J2EE introduction. If you are diligent enough to read it from cover to cover, you will probably be at it for a while (in fact you better hurry if you want to finish it before J2EE 1.4 is finalized!), but by the time you finish, you will certainly have built a solid J2EE foundation.
Sams Teach Yourself J2EE in 21 Days
The hefty Sams Teach Yourself J2EE in 21 Days also traverses vast J2EE territory. Like Professional Java Server Programming, it covers all the salient J2EE points, as well as design patterns and refactoring.
However, from the outset, I found the authors' writing style irksome. Word selection like "utilize" (the three-syllable version of "use") and ubiquitous overloading of the word "against" to mean "to," "with," or "for" ("...uses a connection factory registered against the default JNDI name..." (p. 406)) really annoyed me after a while.
The book's Naming and Directory Services description included (invented?) a reverse mixed metaphor: First the authors equated a phone book to a naming service, then they equated yellow pages to a directory service (because yellow pages allow you to search on additional attributes, not just a name). Subsequently, the text says that a phone book is called a directory because it is in fact a directory service (so what are the yellow pages now?) and finishes with this amusing summary: "The phone directory service lets you look up a person or company's phone book using their name as key." (p. 83) Hmm. I can only guess that the editors were so befuddled, they let this one alone. While such things grate against my sensibilities, I am probably in the minority on this issue and you are free to ignore these criticisms.
Seasoned programmers may find annoying some of the introductory material. Furthermore, the authors' offhand (and incorrect) remarks equating monolithic code with spaghetti code and the assertion that all nonobject oriented programming (OOP) code is, by definition, poorly designed (as well as the silly insinuation that simply switching to OOP transforms poorly designed code into well designed code) doesn't help.
I found the book's CD useful and professionally done. Appropriately named files and an introductory HTML page helps you navigate the CD. The CD also contains the book in PDF format, which can be handy for searching purposes.
Finally, the authors make use of the CD's extra space by including useful tools, including the Ant 1.4.1 build tool, the Forte 3.0 Java IDE, the JBoss 2.4.4 EJB server, and more. Sure, you could download them individually, but this is a nice touch.
While the book includes a Website, it doesn't serve much purpose as everything you need is on the CD.