The power of the Commons libraries is demonstrated in this book. It provides a brief overview of the available components, and details some of them, mostly related to Web access. Application programming interfaces (APIs) are well illustrated through class diagrams and descriptions. One of the best features of the book is its discussion about best practices, warnings, and project ideas. The code examples are interesting, clear, and well commented. The consistent coding standard throughout the book helps with readability.
The book is meant for experienced Java programmers. The author assumes readers have knowledge of JavaServer pages, servlets, Swing, and unified modeling language. Most importantly, he assumes readers are comfortable with learning through code examples. Readers are not assumed to have knowledge of specialized topics like XPath or encryption, but a fair knowledge of Extensible Markup Language (XML) will help readers understand chapter 9 (on logging).
Appendix A contains the entire API of the Commons language. The printed API is difficult to read, and I feel more comfortable using the online JavaDoc. These pages could have been used to cover some missing projects, such as Validator (a must for almost every Java developer) and Digester (essential to parse XML configuration or rule files).
Chapter 1, “Overview,” shows readers where to download the various Commons components, and how to install both the libraries and the documentation into Eclipse. Chapter 2, “FileUpload,” shows how to easily add file upload capabilities to your Web application. Chapter 3, “HttpClient,” shows readers how to programmatically access hypertext transfer protocol (HTTP) resources. HttpClient provides many features, including cookie management. Chapter 4, “Net,” shows how a wide variety of common Internet protocols can be accessed, including file transfer protocol, network news transfer protocol, and others.
Chapter 5, “Pool,” demonstrates the use of a suite of configurable object pools. Chapter 6, “DBCP (Database Connection Pool),” covers the DBCP package, useful for Swing applications and other situations in which a container is not managing database connectivity for you. Chapter 7, “BeanUtils,” shows how the information provided by JavaBeans-style objects can easily be accessed at runtime. Chapter 8 covers JXPath. As you build applications composed of complex graphs of objects, traversing those objects can become tedious. JXPath provides an easy mechanism for walking through these graphs.
Chapter 9 covers logging. Virtually every application can benefit from configurable logging, and the logging package is a good place to get started. Chapter 10 provides an overview of the Lang package. This is one of the most useful packages, but is one of the hardest to get started with. Chapter 11, “Collections,” covers powerful tools for working with collections’ richer object relationships. Chapter 12, “Codec,” shows how to use a suite of specialized conversion routines useful for data transfer, security, and phonetic analysis. Chapter 13, “CLI (Command-Line Interface),” shows readers how to present consistent, useful, command-line configuration and help information with a bonus class path search tool. Chapter 14, “Other Projects,” provides a roadmap for a broad suite of other Commons projects.