Copland 0.2.0 "Appalachian ‘Spring’ " is available for download!
http://rubyforge.org/projects/copland
Version 0.2.0 adds the following new features:
-
Configuration points. These are (more-or-less) just hashes that
service modules may contribute values to. Other services may then use
these configuration points when initializing themselves. This allows
independent services to contribute to one anothers’ initialization. -
Substitution Symbols. This allows you to have specially-formatted
text symbols in your service parameters and properties, which will be
dynamically replaced when the service is instantiated. The values
corresponding to the symbols are taken from a special configuration
point, so you can easily add new symbols or replace existing symbols in
your service modules. -
Multicast services. With these you can tie multiple services
together under one service. Whenever a method of that top-level service
is invoked, the corresponding methods of the contained services are
invoked. And since a multicast service is just another service, you can
tie one to yet another mulitcast service, if you needed to. You can
also add interceptors and listeners (see following) to a multicast
service, just as you can with normal services. -
Listeners. You can register a service with another service, so
that the first service is invoked when a particular event occurs on the
second. Currently, the only events are registry_initialized (invoked
when the Registry is first initialized), service_instantiated (invoked
anytime an instance of the service is created), service_pooled (invoked
whenever a service is returned to a pool of services), and
service_unpooled (invoked whenever a service is removed from a pool). -
Class and Singleton services. You can take any Class that has
class methods and turn it into a service, with the class methods
becoming the methods of the service. Same with any class that includes
the Singleton mixin. As with any other service, you can front these
services with interceptors, listeners, and multicasters, too.
Transparently!
As before, it is available as gem (copland-0.2.0) or as a tar.gz (with
included setup.rb script). Some minor updates have been made to the
documentation (including a justification of IoC), but much more work
remains to be done. Examples of the new features do not exist except in
the unit tests.
Comments and suggestions, as always, are welcome.
···
–
Jamis Buck
jgb3@email.byu.edu
http://www.jamisbuck.org/jamis
ruby -h | ruby -e
’a=[];readlines.join.scan(/-(.)[e|Kk(\S*)|le.l(…)e|#!(\S*)/) {|r| a <<
r.compact.first };puts “\n>#{a.join(%q/ /)}<\n\n”’