O'Reilly logo

Java Cookbook by Ian F. Darwin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Other Books

There is a lot of useful information packed into this book. However, due to the breadth of topics, it is not possible to give book-length treatment to any one topic. Because of this, the book also contains references to many web sites and other books. This is in keeping with my target audience: the person who wants to learn more about Java.

O’Reilly & Associates publishes one of the largest -- and, I think, the best -- selection of Java books on the market. As the API continues to expand, so does the coverage. You can find the latest versions and ordering information on O’Reilly’s Java books in the back pages of this book or online at http://java.oreilly.com, and you can buy them at most bookstores, both physical and virtual. You can also read them online through a paid subscription service; see http://safari.oreilly.com. While many are mentioned at appropriate spots in the book, a few deserve special mention here.

First and foremost, David Flanagan’s Java in a Nutshell offers a brief overview of the language and API, and a detailed reference to the most essential packages. This is handy to keep beside your computer.

Learning Java, by Patrick Niemeyer and Joshua Peck, contains a slightly more leisurely introduction to the language and the APIs.

A definitive (and monumental) description of programming the Swing GUI is Java Swing, by Robert Eckstein, Marc Loy, and Dave Wood.

Java Servlets, by Jason Hunter, and JavaServer Pages, by Hans Bergsten, are both ideal for the server-side web developer.

Java Virtual Machine, by Jon Meyer and Troy Downing, will intrigue the person who wants to know more about what’s under the hood.

Java Network Programming and Java I/O, by Elliotte Rusty Harold, and Database Programming with JDBC and Java, by George Reese, are also useful references.

There are many more; see the O’Reilly web site for an up-to-date list.

Other Java Books

Never consider releasing a GUI application unless you have read Sun’s official Java Look and Feel Design Guidelines (Addison Wesley). This work presents the views of a large group of human factors and user-interface experts at Sun who have worked with the Swing GUI package since its inception; they tell you how to make it work well.

Finally, while authors at other publishing houses might be afraid to mention a book that their publisher might think of as competition to their own, I have found Patrick Chan’s Java Developer’s Almanac (Addison Wesley) a useful addition to my library and a natural complement to my book. While my book features much more detail and discussion than his short “examplets,” the main part of Patrick’s book is a large alphabetical (by class, not by package) reference to the core API. As the core part of his book was produced mechanically using Reflection, the book has a relatively low cover price. By the way, I show you how to generate books like Patrick’s (see Section 25.8), but he doesn’t show you how to write a book like mine.

General Programming Books

Donald E. Knuth’s The Art of Computer Programming has been a source of inspiration to students of computing since its first publication by Addison Wesley in 1968. Volume 1 covers Fundamental Algorithms, Volume 2 is Seminumerical Algorithms, and Volume 3 is Sorting and Searching. The remaining four volumes in the projected series were never completed. Although his examples are far from Java (he invented a hypothetical assembly language for his examples), many of his discussions of algorithms -- of how computers ought to be used to solve real problems -- are as relevant today as 30 years ago.[3]

The Elements of Programming Style, by Kernighan and Plauger, set the style (literally) for a generation of programmers with examples from various structured programming languages. Brian Kernighan also wrote (with P. J. Plauger) a pair of books, Software Tools and Software Tools in Pascal, which demonstrated so much good advice on programming that I used to advise all programmers to read them. However, these three books are somewhat dated now; many times I wanted to write a follow-on book in a more modern language, but instead defer to The Practice of Programming, Brian’s follow-on (co-written by Rob Pike) to the Software Tools series. This book continues the Bell Labs (now part of Lucent) tradition of excellence in software textbooks. I have even adapted one bit of code from their book, in Section 3.14.

Design Books

Peter Coad’s Java Design (PTR-PH/Yourdon Press) discusses the issues of object-oriented analysis and design specifically for Java. Coad is somewhat critical of Java’s implementation of the observable-observer paradigm and offers his own replacement for it.

One of the most famous books on object-oriented design in recent years is Design Patterns, by Gamma, Helm, Johnson, and Vlissides (Addison Wesley). These authors are often collectively called “the gang of four,” resulting in their book sometimes being referred to as “the GOF book.” One of my colleagues called it “the best book on object-oriented design ever,” and I think he’s probably not far off the mark.

Another group of important books on object-oriented design is the UML series by “the Three Amigos” (Booch, Jacobson, and Rumbaugh). Their major works are the UML User Guide, UML Process, and others. A smaller and more approachable book in the same series is Martin Fowler’s UML Distilled.

[3] With apologies for algorithm decisions that are less relevant today given the massive changes in computing power now available.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required