Picture of admin

Build Your Own Spring Config DSL

  • Posted By admin on December 07, 2005

Last week I posted a teaser for a Ruby-based DSL for Spring configuration. Like so many things, I doubt I will ever have time to carry this through so I am posting the code here. Please run with this if you are interested.

Here’s the approach I used:

  • Create RubyBeanFactory as a subclass of XmlBeanFactory.
  • Execute the loaded resource, and treat the result as XML. I used Ruby but you could easily plug in some other language.
  • Create a helper (spring_config.rb) that defines a simple DSL instead of writing straight Ruby code.
  • .
If you plan to use this in production you will want to:
  • Refactor hard-coded stuff
  • Extend the DSL to handle more than just a subset of the Spring config vocabulary

Comments
  1. Board Delhi JalApril 29, 2006 @ 06:13 AM
    Thats correct.
  2. Api Chocolate Vintage PosterMay 06, 2006 @ 09:59 PM
    Very clear...
  3. Kid RobotMay 11, 2006 @ 12:40 AM
    Not really new!