Preface to the Second Edition

JDK 1.5, code-named Tiger, is an exciting change to the Java landscape. It introduces several major new facilities, such as generic types for better data structuring, metadata for annotating Java© classes in a flexible but well-defined manner, new pattern-based mechanisms for reading data, and a new mechanism for formatted printing. In addition, a much larger number of smaller but important changes add up to a new release that is a must for Java developers. It will be quite some time before these mechanisms are fully understood and in wide circulation, but you will want to know about them right away.

I wrote in the Afterword to the first edition that "writing this book has been a humbling experience." I should add that maintaining it has been humbling, too. While many reviewers and writers have been lavish with their praise one very kind reviewer called it "arguably the best book ever written on the Java programming language" I have been humbled by the number of errors and omissions in the first edition. In preparing this edition, I have endeavored to correct these.

At the same time I have added a number of new recipes and removed a smaller number of old ones. The largest single addition is Chapter 8, which covers generic types and enumerations, features that provide increased flexibility for containers such as Java Collections. Now that Java includes a regular expressions API, Chapter 4 has been converted from the Apache Regular Expressions API to JDK 1.4 Regular Expressions.

I have somewhat hesitantly removed the chapter on Network Web, including the JabaDot Web Portal Site program. This was the longest single program example in the book, and it was showing signs of needing considerable refactoring (in fact, it needed a complete rewrite). In writing such a web site today, one would make much greater use of JSP tags, and almost certainly use a web site framework such as Struts (, SOFIA (, or the Spring Framework ( to eliminate a lot of the tedious coding. Or, you might use an existing package such as the Java Lobby's JLCP. Material on Servlets and JavaServer pages can be found in O'Reilly's Java Servlet & JSP Cookbook by Bruce W. Perry. Information on Struts itself can be found in Chuck Cavaness's Programming Jakarta Struts (O'Reilly). Information on SOAP-based web services is included in O'Reilly's Java Web Services by Dave Chappell and Tyler Jewell, so this topic is not covered here.

While I've tested the examples on a variety of systems and provide Ant scripts to rebuild everything, I did most of the new development and writing for this edition using Mac OS X, which truly is "Unix for the masses," and which provides one of the best-supported out-of-the-box Java experiences. Mac OS X Java does, however, suffer a little from "new version lag" and, since 1.5 was not available for the Mac by the time this edition went to press, the JDK 1.5 material was developed and tested on Linux and Windows.

I wish to express my heartfelt thanks to all who sent in both comments and criticisms of the book after the first English edition was in print. Special mention must be made of one of the book's German translators,[1] Gisbert Selke, who read the first edition cover to cover during its translation and clarified my English. Gisbert did it all over again for the second edition and provided many code refactorings, which have made this a far better book than it would be otherwise. Going beyond the call of duty, Gisbert even contributed one recipe (Recipe 26.4) and revised some of the other recipes in the same chapter. Thank you, Gisbert! The second edition also benefited from comments by Jim Burgess, who read large parts of the book. Comments on individual chapters were received from Jonathan Fuerth, Kim Fowler, Marc Loy, and Mike McCloskey. My wife Betty and teenaged children each proofread several chapters as well.

[1] The first edition is available today in English, German, French, Polish, Russian, Korean, Traditional Chinese, and Simplified Chinese. My thanks to all the translators for their efforts in making the book available to a wider audience.

The following people contributed significant bug reports or suggested improvements from the first edition: Rex Bosma, Rod Buchanan, John Chamberlain, Keith Goldman, Gilles-Philippe Gregoire, B. S. Hughes, Jeff Johnston, Rob Konigsberg, Tom Murtagh, Jonathan O'Connor, Mark Petrovic, Steve Reisman, Bruce X. Smith, and Patrick Wohlwend. My thanks to all of them, and my apologies to anybody I've missed.

My thanks to the good guys behind the O'Reilly "bookquestions" list for fielding so many questions. Thanks to Mike Loukides, Deb Cameron, and Marlowe Shaeffer for editorial and production work on the second edition.

Java Cookbook
Java Cookbook, Second Edition
ISBN: 0596007019
EAN: 2147483647
Year: 2003
Pages: 409
Authors: Ian F Darwin

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: