Spring configuration in Ruby. See you later, xml!

Posted by caike on February 13, 2009

I have just started doing some work with Spring. After doing Ruby for some time (and yml in extreme situations), going back to xml can be a PITA. Considering JRuby’s awsome implementation, I was decided to do something Ruby about it but quickly found Springy .

Let’s say

my school (in this little town in the country) has a messenger who can either be a mailman or an email message.

Instead of a few too many lines of xml, I can express the above example like this:

require('config.rb')

bean :school, "com.school.domain.School" do
  messenger :mailman
end
bean :mailman, "com.school.domain.Mailman"

Out xml, in Ruby.

Kudos to Springy ! :D


Performance Optimization WordPress Plugins by W3 EDGE