Preface

Welcome to the wonderfully eclectic world of Jakarta Commons, where everything is always changing and the only constant is change itself. If you?ve never heard of Jakarta Commons, you?re in for a treat; and if you?ve heard of it, then you?re in for some surprises. Jakarta Commons, or Commons for short, bypasses technologies and architectures, provides solutions to common problems, and helps make the work of technical architects and software developers easier. It?s a unique collection of components that are dissimilar in what they do but are united by the common goal of providing solutions for everyday tasks.

This preface provides an insight into the Commons world. It describes the history of this suite of components and discusses its organization, rationale, and charter. This preface also gives you an idea of what to expect in this book?s modules. Let?s start at the beginning.

In the beginning

In the beginning, there was chaos. This chaos resulted from disparate systems creating similar utility modules to solve common problems. The result was multiple copies of multiple utilities thriving in several systems, performing basically the same functions. The problem was compounded when these diverse systems began modifying shared code, resulting in out-of-sync utilities that resembled new utilities rather than a common shared code base.

On March 19, 2001, the first attempt was made to create order out of this chaos. That day, the Jakarta Project Management Committee (PMC) officially adapted a charter that mandated the creation of a subproject under the Apache/Jakarta umbrella called Commons. The PMC wanted to kill two birds with one stone by creating this subproject:

Toward this end, the charter divided the Commons project into two logical and physical entities: the Sandbox and the Commons Proper. The Sandbox is a test pit that serves the charter?s second purpose, and the Commons Proper is the repository of reusable package-driven components. The Sandbox is usually full of components that are in a high state of flux, but it doesn?t contain any actual releases. These components stay in the Sandbox until they?re ready to be released in the Commons Proper, usually via a voting mechanism among the Commons committers. But we?re getting ahead of ourselves.

The initial code base for the Commons subproject came from existing projects in Jakarta and some donated packages. These included Database Pools (now in Pool and DBCP; see module 9), Collections (module 7), Cactus (no longer a Commons project, but a separate Jakarta subproject), HttpClient (module 1), Digester (module 4), Logging (module 14), and BeanUtils (module 8).

The PMC, which was only trying to bring together a few common utility components with this charter, was in for a big surprise: Commons became hugely popular with the open-source Java community and soon developed into the central point for companies to donate package-based Java components and for committers to share ideas.

A lot has changed since that initial charter. Jakarta Commons is now host to 33 (as of February 2005) released components in the Commons Proper. The Sandbox is host to more than 20 components in various stages of development. Several components, like Cactus and HttpClient have grown in stature and are now recognized as separate subprojects within the Jakarta framework. A good measure of the popularity of a technology is the number of books written about it. At last count, there were six books, including this one, in various stages of development on Jakarta Commons. Clearly, Jakarta Commons has arrived and is important enough that all software professionals should understand it.

What?s in it for me?

Are you a technical architect? a software developer/programmer/analyst? a software project manager? If you answered ?Yes? to any of these questions, Jakarta Commons means a lot to you.

I?m a software programmer/developer/analyst

Well, good for you! In addition to being in a role that puts you in direct contact with everything the software world has to offer, you?re also directly responsible for making or breaking the future of your company. (No pressure!) If only you could lay your hands on something that would take the grunt work out of everyday tasks.

Suppose you?re writing a routine in Java to parse a configuration file to create an application?s domain objects. Based on the configuration file architecture, you decide to compose the routine so that it handles additions to or deletions from the array of objects you expect (based on those pesky marketing folks? suggestions). You?re happy with yourself for having written a brilliant routine that is future-proof, and you look forward to your next task. And then you?re fired.

Too bad! Being the brilliant programmer you are, you have no trouble finding another job. But what?s this? A new day, a new job, but you find yourself doing the same thing as before! Your first task is to write a configuration parser for the new company?s applications. If only you could have sneaked away with the copyrighted code from your previous company. Ethical behavior prevented you from doing so, right?

The point of this scenario is to illustrate the fact that as software developers, we encounter tasks in our programming life cycles that are repetitive and nonunique. Around the world, software developers encounter the same problems and do exactly what each of us does. We repeat solutions instead of converging on one shared and proven technology. Sharing saves time and alleviates common mistakes.

Of course, some of us (actually, a lot of us, considering the last count of the Commons mailing list) have started to see the light?the light at the end of the Jakarta Commons tunnel. The tunnel is filled with solutions to everyday, repetitive, proven tasks, with a worldwide community of developers as a support base. Can you afford not to look at the light?

I?m a technical architect

That means you already sort of know about Jakarta Commons. At least, you already know about the open-source solutions provided for common architectural problems from the Apache stable. Jakarta Commons must already be in your periphery.

Even if it isn?t, it?s time that you looked at it seriously. You?re responsible for creating the blueprints of software applications and creating robust, maintainable architectures; this requires knowledge of the best possible solutions to common architectural problems. Jakarta Commons offers a smorgasbord of technologies that are relevant and indispensable once you realize their benefits.

For example, consider that as part of your architecting duties, you?re supposed to provide solutions to consistently and effectively write detailed logs from an application. As an architect, you want a generalized approach to such a problem rather than narrowing the focus by suggesting exact logging techniques and software components (and earning the wrath of software developers for encroaching on their territory). But how do you do that? Do you suggest the creation of an in-house Logging API and expand previous resources? Do you take a leap of faith and suggest exact external solutions?for example, by espousing the use of one product over another? Maybe. But there is a better way.

You could, instead, suggest the use of the Jakarta Commons Logging component (see module 14). This component doesn?t tie your application to a single logging architecture; instead, it lets you use multiple implementations via a single interface. It?s a wrapper around other logging components, using a simple, intuitive, well-defined access mechanism.

Not only does this solution endear you to your clients (perhaps because you used an open-source solution, thus saving money; or because you saved time in delivering a solution), it also causes you to be well liked by the software developers, because they?re free to choose the right logging algorithm.

Commons is full of such components. Happy exploring in this book?s table of contents!

I?m a project manager

I?ve been meaning to talk to you about the raise I was promised! On a more serious note, you?re responsible for delivering cost-effective and timely solutions to your clients (whoever they may be, internal or external to your organization) and managing the day-to-day activities of application development. One of today?s hot topics, open-source solutions, is your gateway to cutting costs and still delivering effective solutions.

Although this isn?t a book about the virtues of open-source, this is a book about open-source technologies. Specifically, this book is about the Jakarta Commons suite of open-source components. If you?ve already started using open-source in your organization, you already know the benefits it provides. If you haven?t, then this book can serve as an introduction to several of these components at once. Each of the Jakarta Commons components can be a gentle introduction to the world of open-source for you, and this book is the best medium to learning about them.