Intrinsic Difficulty

Dr. Dobb's Journal September 2002

By Jack J. Woehr

Jack is a consultant working in wireless communications. He can be reached via his web page at http://www.softwoehr.com/.


CodeNotes for J2EE
edited by Gregory Brill and John Gomez
Random House, 2002
240 pp., $19.95
ISBN 0812991907

Enterprise Java Servlets
Jeff M. Genender
Addison-Wesley, 2001
464 pp., $39.99
ISBN 020170921X

XML, XSLT, Java, and JSP
Westy Rockwell
Pearson Education, 2001
746 pp., $49.99
ISBN 0735710899

Game theory presents the concept of intrinsic difficulty. A game problem is intrinsically difficult when it must be solved back-to-front, such as Chess or Go endings.

The challenge of deploying a successful and secure commercial web application constitutes the sort of real-world situation that game theory manipulates in its tiny, closed-world models.

Over the past 14 months, I have directed just such a deployment for a startup. Over the same period, I have examined many books touching on aspects of deploying these sorts of web applications. Many are excellent. I'll look at three of my favorites, from lightest to heaviest. The theme of intrinsic difficulty recurs.

The first intrinsic difficulty in deploying a successful and secure commercial web application is conceptual. The concept is Enterprise JavaBeans (EJB). For justifiable commercio-technical reasons, EJB is wrapped in terminology that makes it hard to discover the Zen of the matter, but what it comes down to is that EJB is Java-ese for "Transaction Processing Facility," which was how all transaction processing was conceived at the top end when Nobody Ever Got Fired For Buying IBM.

In the Java utopia, EJB is how you do transaction processing. There is no other way in a Java web application — believe me, I've tried.

CodeNotes for J2EE, edited by Gregory Brill and John Gomez, makes it a little easier. You're not going to learn J2EE just from this book. The theory is best acquired starting from the Enterprise JavaBeans 2.0 Specification. You acquire the practice from coding and configuring your own deployment. The deuce is in the details. Even after you've grasped the paradigm, you'll need a quick refresher for the parts you've studied and an explainer for the parts you've forgotten to study.

Each chapter is divided into topics, and each topic into sections such as "Prerequisites," "Core Concepts," "How and Why," "Design Notes," "Bugs and Caveats," and so forth.

CodeNotes for J2EE is clear, concise, and not overbearing; and the editors are well informed and experienced in the technology. There is little or no ideology here: Open source Apache-Jakarta stands alongside commercial vendors such as BEA and Borland.

CodeNotes for J2EE is the book you want if you've gotten to the point of asking "How do I store state persistently in a stateless session bean?" (answered on page 160), or if you need a quick pick-me-up on how to build a cookie, or if you're not clear on the lifecycle of a servlet page. It's small, light, reasonably priced, and belongs on your desk.

The next intrinsic difficulty is that you have to deploy in an actual environment — the servlet environment. Of the vertical stack of vendor tools (including open source) that makes up the run-time environment of your web application, the Java Servlet seems to have stayed closest to the original idea. Back in ancient times (1997?), people were using Java as CGI, which amounted to spawning the multimegabyte Java Virtual Machine once for every request. While programmers worked around this on an application basis, Sun conceptualized the Servlet Engine, one instance of the JVM that handled all service requests.

Servlets accomplish the classic goal of enterprise system programming: They reduce much of what used to be a task of programming to a task of administrative configuration. I used to marvel at IBM shop specialists who focused on one to three mainframe applications, but it's happening now in the Java world. You could spend the rest of your career tuning and maintaining servlets.

Enterprise Java Servlets, by Jeff Genender, is a clear and calm exploration of the Servlet environment. Genender describes complex code scenarios with skill. As a vector sum of completeness, clarity, and ease of reading, this book scores high. It introduces servlets, then takes you back to HTTP forms so you can pick up where the original model for the interactive Web left off. HTML templates, particularly Java Server Pages (JSP), are addressed. You walk through servlet creation and deployment. Challenges arising from the Servlet model, such as database connection pooling, are addressed with code. Throughout, Genender exhibits a lively and entertaining interest in the peripheral technology JNDI — especially JNDI over LDAP. The CD-ROM contains a complete Apache/Tomcat deployment environment.

The final intrinsic difficulty is the sheer weight of the plethora of technologies you've been forced to assimilate one after another. Still, XML, XSLT, Java, and JSP is the best book I've found for racing you over the hurdles faced when formatting our web content. You already swallowed the technology: It may be difficult, but with books like this one around, you'll probably live.

DDJ