[ANN] Copland 0.6.0

Copland is an Inversion of Control (IoC) or Dependency Injection container for Ruby, inspired by the design of the HiveMind container for Java.

   http://copland.rubyforge.org

Version 0.6.0 is an almost 100% rewrite of the previous version, and it has been designed (this time) from the ground up with extensibility and thread-safety in mind. It is _not_ backwards compatible with previous releases of Copland, but since Copland is still only alpha-release software, such API changes are to be expected.

Also, version 0.6.0 changes the license from Ruby's to BSD's.

Those of you that have been following Copland may be wondering what happened to version 0.5.0... that's the version that was in CVS when I decided to scrap it and rewrite it all. It was never released, and is already superceded by something better.

Much has changed internally in version 0.6.0, but there have been quite a few user-visible changes as well:

* The term "module" was confusing, since it was hard to tell when a Copland module was being referred to versus a Ruby module. The term "package" is now used instead.

* The "simple" and "simple-deferred" service models have been renamed to "prototype" and "prototype-deferred", which better describe their purpose.

* The registry is no longer a singleton. It is instantiable, just like any other object. This should make Copland more WEBrick-friendly, among other things.

* The LogFactory is no longer a singleton, and has been made a property of the registry. This means that each registry instance can manage its own logging subsystem. Again, this makes things more WEBrick-friendly.

* The package descriptor format has changed slightly--see the Copland user manual for the new format. (In particular, schemas are now done completely differently, and the 'create-instance' and 'invoke-factory' elements are gone, in favor of a unified 'implementor' element.)

* Defining schemas is now MUCH easier than it was before. I have removed the rule-digester routines (which were inspired by HiveMind) in favor of a much simpler approach. The digester works well for Java, but is overkill for a dynamic language like Ruby.

* You can now put multiple package descriptors in a single file. Just format the file as you would for any YAML file containing multiple documents.

* The package processor does a LOT more validation than it used to. This should make it easier to identify errors in package descriptors. Also, if/when line number reporting is added to Syck, error reporting in Copland will become that much more wonderful.

* An emphasis on "fail-fast" has made it so that errors are detected sooner rather than later. Types are checked (where necessary), schemas are employed judiciously, and the package processor is MUCH more sophisticated than it used to be.

* Part of the changes in the logging subsystem made it necessary to remove the dependency on Log4r. Log4r is a great logging system, but I needed to move away from a singleton-based implementation. Ruby's standard 'logger' implementation works adequately (though there are a few things I wouldn't mind seeing changed...)

* Interceptor ordering is no longer number-based. It follows HiveMind's recent addition of "before" and "after" lists, where you can explicitly request that the interceptor be ordered before or after other interceptors.

* The new AutoLoad service (the mirror of HiveMind's EagerLoad service) is available for services that need to start when the registry starts, but for which certain ordering constraints exist.

* The SynchronizingInterceptor now has a single mutex per method, instead of one mutex per object. This makes finer-grained synchronization possible.

Of course, under the covers Copland is a completely different beast than it was before. It has been completely refactored in favor of more, smaller components, instead of fewer, larger components.

There is a much-more-comprehensive test suite available now, as well. The previous version of Copland had a test suite as well, but it was not nearly as comprehensive. Many of the internal design changes in Copland were necessary to accomodate unit testing (in particular, Registry's change from singleton to object).

And, lastly, the user manual has been updated to reflect the new changes. The original tutorials have all been scrapped. Two new ones, part of a series to replace the old tutorials, are already available.

Anyway, that's the low-down on the changes. Feel free to download it and try it out. Feedback will be greatly appreciated!

···

--
Jamis Buck
jgb3@email.byu.edu
http://www.jamisbuck.org/jamis

"I use octal until I get to 8, and then I switch to decimal."