[フレーム]
BT

InfoQ Software Architects' Newsletter

A monthly overview of things you need to know as an architect or aspiring architect.

View an example

We protect your privacy.

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Unlock the full InfoQ experience

Unlock the full InfoQ experience by logging in! Stay updated with your favorite authors and topics, engage with content, and download exclusive resources.

Log In
or

Don't have an InfoQ account?

Register
  • Stay updated on topics and peers that matter to youReceive instant alerts on the latest insights and trends.
  • Quickly access free resources for continuous learningMinibooks, videos with transcripts, and training materials.
  • Save articles and read at anytimeBookmark articles to read whenever youre ready.

Topics

Choose your language

InfoQ Homepage News Springy Brings JRuby Power to Spring Configuration

Springy Brings JRuby Power to Spring Configuration

Dec 07, 2006 2 min read

Write for InfoQ

Feed your curiosity. Help 550k+ global
senior developers
each month stay ahead.
Get in touch

Last week's coverage of RSpec on Ruby (more coverage is available here) included the thought that JRuby was poised to start making waves by providing new, Ruby influenced tools to Java developers. Springy looks like just the kind of tool Michael Studman was thinking of when he wrote:

I hope that ... more Java developers to sit up and notice Ruby as a language with incredible potential for all manner of problems.

Springy is a simple DSL, written in JRuby, that lets Java developers wire up their Spring contexts without having to do "XML sit-ups". For example:

<bean id="bean3" class="springy.beans.Bean3">
<constructor-arg value="${vic}"/>
<constructor-arg ref="bean2"/>
<property name="aProperty">
<list>
<ref bean="bean1"/>
<value>A String</value>
</list>
</property>
</bean>
becomes:
bean :bean3, "springy.beans.Bean3" do |b| 
b.new(vic, :bean2).aProperty = [ :bean1, "A String" ]
end
(Contrived example taken from Jan Berkel's blog post about Springy.)
When asked about his use of JRuby, Jan said:
We [Trampoline Systems] use a hybrid development strategy, using (C)Ruby on Rails for the frontend and Java for all backend related things (actually with bits of Lisp in it as well). It's really a "best-tool-for-the-job" approach. Ruby/Rails is agile and productive whereas Java is the big guy in the background who does the heavy lifting.
And Springy's not the only way they're using JRuby:
Our build system is based on Rake with some Java-related extensions (which we've opensourced recently — Jerbil). It reduced the complexity of our build system from ca. 1500 lines of XML to 180 lines of Ruby, largely thanks to Ruby's metaprogramming capabilities.
While Springy isn't in wide use yet (it's only been publicly available for about 2 weeks), it certainly shows promise. It also shows how well JRuby can leverage rubyisms for Java developers. Jan talked about this too:
JRuby makes it very easy to extend existing Java code: it is getting to a point now where the boundaries between languages almost completely disappear, at least from a Ruby perspective. You can use and extend Java classes in a very natural way whilst retaining Ruby's power and flexibility.
The question doesn't seem to be "Will JRuby have an impact on Java developers?", it's "Where in Java world will JRuby's impact be felt most strongly?". The first several 'cross-overs' have already occured. Where will JRuby show up next.

Rate this Article

Adoption
Style

This content is in the Java topic

Related Topics:

Related Content

The InfoQ Newsletter

A round-up of last week’s content on InfoQ sent out every Tuesday. Join a community of over 250,000 senior developers. View an example

We protect your privacy.

BT

AltStyle によって変換されたページ (->オリジナル) /