[ANN] Copeland 0.1.0

Copeland 0.1.0 “Fanfare for the Common Programmer” is ready for public
consumption. http://copeland.rubyforge.org

Copeland is an Inversion of Control (IoC) container for Ruby, based
closely on the Hivemind project (for Java). It allows developers to
specify the dependencies and relationships between objects in a
configuration file (YAML, of course), and the container will then
dynamically tie those interrelated objects together at runtime, either
by passing dependencies as constructor parameters or by setting them as
properties.

Copeland also supports the concept of interceptors, which can sit
between a client and a service and ‘intercept’ any method call on the
client. The interceptor then has the option to forward the request
along, perform a different action altogether, or even just abort the
request. As with everything else IoC, interceptors may be applied
dynamically to a service by specifying them in the module descriptor file.

There are still bells and whistles left to implement (I mean, hey, it’s
only version 0.1) but it has sufficient functionality right now for
fairly complex programs.

Hopefully, Copeland will be available as a remotely installable ruby gem
in the near future. For those of you that want to try it right now, you
can go to http://rubyforge.org/projects/copeland and grab either the gem
file (if you want the gem install) or the .tar.gz file (for a standard
setup.rb-based library install). Either way, you’ll need to make sure
that you also have Log4r [1] installed, since Copeland uses it extensively.

Pound on it, and let me know what you think of it. In particular, if
you have prior IoC container experience (especially Hivemind) your input
will be very welcome.

Thanks!

Jamis Buck

[1] http://log4r.sourceforge.net

···


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”’

Jamis Buck wrote:

Copeland 0.1.0 “Fanfare for the Common Programmer” is ready for public
consumption. http://copeland.rubyforge.org

This sounds interesting, though I certainly don’t understand it yet.

Please keep us informed.

BTW, if you’re naming this after Aaron Copland as it appears, then you
should fix the spelling.

Cheers,
Hal

Hal Fulton wrote:

BTW, if you’re naming this after Aaron Copland as it appears, then you
should fix the spelling.

Ugh. Bitten by Google again. I guessed at the spelling (Copeland) and
googled for Aaron Copeland, and got hits back. I should have guessed
that others would have spelling as bad as mine. Blah.

As for fixing the spelling… the RubyForge project name is copeland,
the CVS repository is copeland… At this point, I think the spelling
will remain Copeland as a legacy to my lousy research.

Unless someone can recommend an easy way of renaming everything? :frowning:

  • Jamis
···


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”’

Create a new project (copland), then checkout the old one, then:

cd copeland
ruby -pi.bak -e ‘gsub(/(copeland)/) { $1.delete(“Ee”) }’ find . -type file
rm `find . -type file -name “*.bak” # if it worked ok

then import into copland :slight_smile:

David

···

On Wed, 17 Mar 2004, Jamis Buck wrote:

Hal Fulton wrote:

BTW, if you’re naming this after Aaron Copland as it appears, then you
should fix the spelling.

Ugh. Bitten by Google again. I guessed at the spelling (Copeland) and
googled for Aaron Copeland, and got hits back. I should have guessed
that others would have spelling as bad as mine. Blah.

As for fixing the spelling… the RubyForge project name is copeland,
the CVS repository is copeland… At this point, I think the spelling
will remain Copeland as a legacy to my lousy research.

Unless someone can recommend an easy way of renaming everything? :frowning:


David A. Black
dblack@wobblini.net

As for fixing the spelling… the RubyForge project name is copeland,
the CVS repository is copeland… At this point, I think the spelling
will remain Copeland as a legacy to my lousy research.

Unless someone can recommend an easy way of renaming everything? :frowning:

Ack, yeah, I should have noticed that, sorry Jamis. Oh well.

Anyhow, if you put in a “copland” project, I’ll approve it and copy over
your current CVS module…

Yours,

Tom

I thought the project was named after Tom Copeland :wink:

BTW: the purpose of the project is unclear to me.
I tried browse the rdocs but didn’t got any wiser.

···

On Wed, 17 Mar 2004 08:10:59 +0900, Jamis Buck wrote:

Hal Fulton wrote:

BTW, if you’re naming this after Aaron Copland as it appears, then you
should fix the spelling.

Ugh. Bitten by Google again. I guessed at the spelling (Copeland) and
googled for Aaron Copeland, and got hits back. I should have guessed
that others would have spelling as bad as mine. Blah.

As for fixing the spelling… the RubyForge project name is copeland,
the CVS repository is copeland… At this point, I think the spelling
will remain Copeland as a legacy to my lousy research.

Unless someone can recommend an easy way of renaming everything? :frowning:


Simon Strandgaard

David A. Black wrote:

Create a new project (copland), then checkout the old one, then:

cd copeland
ruby -pi.bak -e ‘gsub(/(copeland)/) { $1.delete(“Ee”) }’ find . -type file
rm `find . -type file -name “*.bak” # if it worked ok

then import into copland :slight_smile:

David

Thanks for the great one-liner, David. Seems like I’m always surprised
by the power of Ruby-from-the-commandline. I wound up writing a simple
script to do it, though, since I also needed to rename files and
directories if they were called /[Cc]opeland/.

So, I’ve submitted a new project proposal to RubyForge (called Copland,
this time, instead of Copeland…my only concern is that someone will
think it’s a game about law enforcement…)

As soon as the project is approved, I’ll check in the refactored sources
and start anew. (Tom, that means that as soon as the Copland factory is
given the green light, you can wipe the Copeland one from the face of
the earth, CVS repository and all.)

Here’s to lousy spelling…

  • Jamis
···


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”’

Simon Strandgaard wrote:

BTW: the purpose of the project is unclear to me.
I tried browse the rdocs but didn’t got any wiser.

The docs are a work in progress, and are written with the expectation
that the reader knows what Inversion of Control is (though a better term
is Dependency Injection). I hope to fix that eventually, but for now
the best I can do is direct you to other documentation:

Here’s a description of IOC from the Avalon Apache project:
http://avalon.apache.org/framework/cop/guide-patterns-ioc.html

Here’s a description of the Spring framework (one of the several Java
IOC containers):
http://www.theserverside.com/articles/article.tss?l=SpringFramework

Here’s a great essay on Inversion of Control and Dependency Injection:

found them to be particular useful at decoupling the component pieces of
an application. It also is very powerful when you need to be able to
swap out specific implementations of a component, because you can do it
without modifying any code at all (you just have to make a change to the
configuration file(s)).

Has anyone else had more experience with IoC containers? Anything else
to add?

···

From my own (admittedly limited) experience with IoC containers, I’ve


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”’

So, I’ve submitted a new project proposal to RubyForge
(called Copland,
this time, instead of Copeland…my only concern is that someone will
think it’s a game about law enforcement…)

Heh, that’s classic.

As soon as the project is approved, I’ll check in the
refactored sources
and start anew. (Tom, that means that as soon as the Copland
factory is
given the green light, you can wipe the Copeland one from the face of
the earth, CVS repository and all.)

Cool, done!

Yours,

Tom

Okay, this time I mean it.

Copland 0.1.0 “Fanfare for the Common Programmer” is now available. As
before, you can grab either the ‘gem’ distribution or the 'tar.gz’
distribution from its project website:

http://rubyforge.org/projects/copland

The main page is at:

http://copland.rubyforge.org

A new version of the gem file is on its way to Chad right now, so
hopefully the remote-install will work for Copland in the near future.

Thanks to David for the tip on changing the project name, Hal for
pointing out the typo, Tom for working so hard to get the Copland
project up-and-running on RubyForge so quickly, and Chad for taking care
of the RubyGems stuff. Oh, and Dave Thomas for rdoc. I’ve become quite
hooked on it. :wink:

What a great community!

···


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”’

I have no experience with IoC and actually I don’t even think I
understood what it is. But it’s worth noting that there was already a
projetc of inversion control in ruby:
http://www.picocontainer.org/rico/

I’m just saying in case you did’nt know , and to show that there is at
least another rubyist that knows IoC :slight_smile:

···

il Wed, 17 Mar 2004 12:42:20 +0900, Jamis Buck jgb3@email.byu.edu ha scritto::

Has anyone else had more experience with IoC containers? Anything else
to add?

gabriele renzi wrote:

I have no experience with IoC and actually I don’t even think I
understood what it is. But it’s worth noting that there was already a
projetc of inversion control in ruby:
http://www.picocontainer.org/rico/

I had looked at rico (which is based on the PicoContainer project), but
it is only a proof-of-concept (which they admit on the site). It seemed
to me that a more robust solution was needed in Ruby for developers who
want to create enterprise-level applications. (For what its worth, I
don’t believe Copland is very robust yet–it isn’t very thread-safe, for
one, and lacks several features to make it enterprise-ready.)

It was encouraging, though, to see that I wasn’t the first one to think
of writing an IoC container in Ruby. :slight_smile:

···


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”’