ThoughtWorksThoughtWorks
NEAL FORD software architect / meme wrangler
ThoughtWorks
[email protected] 3003 Summit Boulevard, Atlanta, GA 30319
www.nealford.com
www.thoughtworks.com
blog: memeagora.blogspot.com
twitter: neal4d
comparing groovy & jruby *
* please check all knives, guns, pitchforks, and torches at the door
housekeepingask questions at the end (insane amount of material!)
download slides from nealford.com
download samples from github.com/nealford
in Groovy, everything is an object...
in Java™, everything is an object...
...except primitives and nulls
in JRuby, everything is an object
except null
everything except...
JRuby adds artifacts to “Rubify” Java™
...but doesn’t add collection stuff to Object
JRuby additions
ArrayList
Fixnum
“fake out” interfaces via closures using as
allows you to interact with Java™ interfaces
can wrap proxies around them if needed
Groovy & interfaces
named after ice cream mix-ins
mixin
first appeared in symbolic logic’s flavors system
a way to collect functionality
not a form of specialization
Ruby has no interfaces
attr_reader, attr_writer, attr_accessor
much of Ruby’s infrastructure is meta-programming
meta-programming methods:
private, protected, public
include
executable declarations
use Groovy to simplify and humanize them
leverage the existing industrial strength Java™ stack
encapsulate best-of-breed frameworks
encapsulate, then build up
Groovy & Grails
Ruby on Rails = software factories + dsl’s
tends to build things as abstraction layers atop Ruby using meta-programming & dsl techniques
lightweight abstraction layers
Ruby language is always 1 abstraction layer down
Ruby
BlankSlate
Recorder
Jim Weirich’s BlankSlate1.8
1.9BasicObject
BasicObject
Recorder
Object
RecorderBuilder Builder
abstractions with dsl’s
Groovy encapsulates and builds up
Ruby either builds
via meta-programming
different philosophies
the real JDK™ 2.0!
unparalleled Java™ integration
willing to evolve the language
building up from best-of-breed
the good
never spread out of the Java™ community
fast changing at the core
single runtime platform
framework approach?
the bad
futuristic framework approach
well established (older than Java™)
virtually effortless meta-programming
interpreted, then jit-ted
truly cross platform, for the new definition of platform
the good
unfamiliar frameworks
some impedance mismatch with Java™ (smaller all the time)
yet another language to learn
you have to learn to think like a Ruby-ist
you have to switch to a new community
the bad
ThoughtWorks
This work is licensed under the Creative Commons Attribution-Share Alike 3.0 License.
http://creativecommons.org/licenses/by-sa/3.0/us/
?’splease fill out the session evaluationssamples at github.com/nealford
NEAL FORD software architect / meme wrangler
ThoughtWorks
[email protected] 3003 Summit Boulevard, Atlanta, GA 30319
www.nealford.com
www.thoughtworks.com
blog: memeagora.blogspot.com
twitter: neal4d
resources
ThoughtWorks
groovy web sitehttp://groovy.codehaus.org
jruby sitehttp://jruby.codehaus.org
Cow in the Road photo by Sophia Huda, from Flickr, under a Creative Commons license
charles nutter’s bloghttp://headius.blogspot.com/
ola bini’s bloghttp://olabini.blogspot.com/