Java News from Friday, December 10, 2004

The Apache Incubator Project has released Apache Derby (formerly Cloudscape), and open source relational database written in pure Java.

The Apache Jakarta Commons Project has released Commons Math 1.0, an open source library providing many mathematical functions for statistics, random data generation, linear algebra, root finding, interpolation, erf, gamma and beta functions, arrays, factorials, complex numbers, distributions, matrices, and solving linear systems. It looks like it covers most practical math you might encounter at roughly the level of a typical undergraduate course in mathematical methods for physics. Based on spot checks of the Complex class and the factorial function, this looks like pretty solid work. I don't see any of the usual mistakes I'm used to seeing in such classes. For instance, the MathUtils.factorial() method throws an ArithMeticException if the result overflows the bounds of a long. Commons Math is published under the Apache 2.0 license.

The Apache Jakarta Commons Project has also released Commons Chain 1.0, an open source implementation of the Chain of Responsibility design pattern. According to the web page,

A popular technique for organizing the execution of complex processing flows is the "Chain of Responsibility" pattern, as described (among many other places) in the classic "Gang of Four" design patterns book. Although the fundamental API contracts required to implement this design patten are extremely simple, it is useful to have a base API that facilitates using the pattern, and (more importantly) encouraging composition of command implementations from multiple diverse sources.

Towards that end, the Chain API models a computation as a series of "commands" that can be combined into a "chain". The API for a command consists of a single method (execute()), which is passed a "context" parameter containing the dynamic state of the computation, and whose return value is a boolean that determines whether or not processing for the current chain has been completed (true), or whether processing should be delegated to the next command in the chain (false).

Commons Math is published under the Apache 2.0 license.