Your SlideShare is downloading. ×
0
Rails on Spring
Using JRuby as the Secret Sauce


        Brian Sam-Bodden
Agenda

 The State of Java and JEE

Ruby on Rails to the Rescue

 Ruby makes Rails possible

  The Spring Framework
Agenda

    JRuby - Ruby on Steroids

          JRuby on Rails

JRuby for Rapid Spring Prototyping

    JRuby on Rails and...
The State of Java and JEE
Java & JEE

     the most prevalent language

the most complete enterprise platform

 a rich ecosystem of web frameworks

...
Java & JEE

   plagued by mediocre web frameworks

    not well suited for rapid prototyping

in need of a dynamic languag...
Who could help Java on the Web Tier?
Ruby on Rails

a revolutionary web framework

   complete MVC solution

       fast prototyping

     killer AJAX support
Ruby on Rails

         a DSL for the web

leading the pack on the web 2.0 front

born from a product, not a committee

  ...
Ruby makes Rails possible
✓Object-Oriented
     ✓Elegant                        ✓General Purpose


✓ Multi-paradigm
                   Ruby         ...
The Spring Framework
 A breath of fresh air for Java
The Spring Framework

      is a layered Java/J2EE application framework

        is a lightweight IoC and AOP framework

...
The Spring Framework

      let’s you use all of the power of JEE

     integrates seamlessly with Hibernate

POJO-based d...
The Spring Framework

  Spring 2.0 supports dynamic languages

 support for JRuby, Groovy and BeanShell

beans can be back...
JRuby
Ruby on Steroids
JRuby

100% pure-Java implementation of Ruby

        brings Ruby to the JVM

started in 2002, now under Sun’s auspice

op...
JRuby

call Ruby from Java or Java from Ruby

    lots of sub-projects emerging

better scalability with native threading
...
JRuby

specialized JRuby offerings are appearing...
The good gets better
JRuby on Rails

the agility of rails - the scalability of Java

 JRuby likely to surpass Ruby in speed

sneak Ruby and RoR...
JRuby on Rails
JRuby on Rails
JRuby on Rails

       JEE servers are good at scaling up

      no more multi-process management

         use JRuby “mul...
JRuby on Rails
 deploy your Rails app as a WAR

leverage JDBC from ActiveRecord
JRuby
       For Rapid Spring Prototyping
...one way of sneaking Ruby in through the back door
JRuby+Spring RAD

      a simple example by the folks at jobster

          use JRuby for rapid prototyping

Spring contro...
JRuby+Spring RAD




   Simple JRuby controller
JRuby+Spring RAD




JSP view provides input to the Ruby controller
JRuby+Spring RAD




JSP view provides input to the Ruby controller
JRuby+Spring RAD

   this experimental library supports:

✓access to Spring beans from JRuby code
    ✓ access to Hibernat...
The Perfect Pairing
  for a Java Shop
 JRuby on Rails + Spring
JRoR on Spring
         Chris Nelson’s work


            ✓use rails-integration plugin
✓ expose WebApplicationContext in ...
JRoR on Spring
✓install goldspike rails-integration plugin on you JRoR app


 ✓ rake war:standalone:create to package a WA...
JRoR on Spring
rake war:standalone:create in action:
JRoR on Spring
generated WARs work on many servers:


    ✓Tomcat        ✓Glassfish
     ✓Jetty          ✓JBoss
JRoR on Spring
✓   add Chris’ Spring module:
JRoR on Spring

✓ Expand the generated   WAR

✓Add Spring application
   ➡ Application Code
   ➡ Libraries (Jars)
   ➡ Con...
JRoR on Spring
✓   access your Spring beans from a RoR controller
JRoR on Spring

   ✓add a new face to your Spring applications
 ✓   leverage thousands of open source projects

✓leverage ...
Resources
                               JRuby
                            www.jruby.org
                  rubyforge.org/p...
Books by Integrallis




 Yes, they are all Java books :-(
Thanks!
Upcoming SlideShare
Loading in...5
×

Rails On Spring

3,491

Published on

A look at the impossible, the marriage between Ruby and Spring.
integrallis.com

Published in: Technology
1 Comment
3 Likes
Statistics
Notes
No Downloads
Views
Total Views
3,491
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
33
Comments
1
Likes
3
Embeds 0
No embeds

No notes for slide

Transcript of "Rails On Spring"

  1. 1. Rails on Spring Using JRuby as the Secret Sauce Brian Sam-Bodden
  2. 2. Agenda The State of Java and JEE Ruby on Rails to the Rescue Ruby makes Rails possible The Spring Framework
  3. 3. Agenda JRuby - Ruby on Steroids JRuby on Rails JRuby for Rapid Spring Prototyping JRuby on Rails and Spring
  4. 4. The State of Java and JEE
  5. 5. Java & JEE the most prevalent language the most complete enterprise platform a rich ecosystem of web frameworks a vibrant open source community
  6. 6. Java & JEE plagued by mediocre web frameworks not well suited for rapid prototyping in need of a dynamic language web framework one level of abstraction too low for the web
  7. 7. Who could help Java on the Web Tier?
  8. 8. Ruby on Rails a revolutionary web framework complete MVC solution fast prototyping killer AJAX support
  9. 9. Ruby on Rails a DSL for the web leading the pack on the web 2.0 front born from a product, not a committee a vibrant open source community
  10. 10. Ruby makes Rails possible
  11. 11. ✓Object-Oriented ✓Elegant ✓General Purpose ✓ Multi-paradigm Ruby ✓ Interpreted is... ✓Reflective ✓Dynamic ✓ Garbage-collected
  12. 12. The Spring Framework A breath of fresh air for Java
  13. 13. The Spring Framework is a layered Java/J2EE application framework is a lightweight IoC and AOP framework is one level of abstraction up from JEE is the leading framework to build enterprise applications
  14. 14. The Spring Framework let’s you use all of the power of JEE integrates seamlessly with Hibernate POJO-based development keeps your code clean harnesses the power of IoC and AOP
  15. 15. The Spring Framework Spring 2.0 supports dynamic languages support for JRuby, Groovy and BeanShell beans can be backed by dynamic languages scripted MVC controllers
  16. 16. JRuby Ruby on Steroids
  17. 17. JRuby 100% pure-Java implementation of Ruby brings Ruby to the JVM started in 2002, now under Sun’s auspice open source with a growing community
  18. 18. JRuby call Ruby from Java or Java from Ruby lots of sub-projects emerging better scalability with native threading native unicode support
  19. 19. JRuby specialized JRuby offerings are appearing...
  20. 20. The good gets better
  21. 21. JRuby on Rails the agility of rails - the scalability of Java JRuby likely to surpass Ruby in speed sneak Ruby and RoR into the enterprise!
  22. 22. JRuby on Rails
  23. 23. JRuby on Rails
  24. 24. JRuby on Rails JEE servers are good at scaling up no more multi-process management use JRuby “multi-VM” support leverage the maturity of the JVM and JEE servers
  25. 25. JRuby on Rails deploy your Rails app as a WAR leverage JDBC from ActiveRecord
  26. 26. JRuby For Rapid Spring Prototyping ...one way of sneaking Ruby in through the back door
  27. 27. JRuby+Spring RAD a simple example by the folks at jobster use JRuby for rapid prototyping Spring controller that delegates to a JRuby controller JRuby controllers live alongside your JSPs
  28. 28. JRuby+Spring RAD Simple JRuby controller
  29. 29. JRuby+Spring RAD JSP view provides input to the Ruby controller
  30. 30. JRuby+Spring RAD JSP view provides input to the Ruby controller
  31. 31. JRuby+Spring RAD this experimental library supports: ✓access to Spring beans from JRuby code ✓ access to Hibernate queries
  32. 32. The Perfect Pairing for a Java Shop JRuby on Rails + Spring
  33. 33. JRoR on Spring Chris Nelson’s work ✓use rails-integration plugin ✓ expose WebApplicationContext in a RoR controller ✓include Spring - Spring plugin for JRuby
  34. 34. JRoR on Spring ✓install goldspike rails-integration plugin on you JRoR app ✓ rake war:standalone:create to package a WAR with: ➡Your RoR app ➡JRuby and Rails libraries
  35. 35. JRoR on Spring rake war:standalone:create in action:
  36. 36. JRoR on Spring generated WARs work on many servers: ✓Tomcat ✓Glassfish ✓Jetty ✓JBoss
  37. 37. JRoR on Spring ✓ add Chris’ Spring module:
  38. 38. JRoR on Spring ✓ Expand the generated WAR ✓Add Spring application ➡ Application Code ➡ Libraries (Jars) ➡ Config Files
  39. 39. JRoR on Spring ✓ access your Spring beans from a RoR controller
  40. 40. JRoR on Spring ✓add a new face to your Spring applications ✓ leverage thousands of open source projects ✓leverage the good parts of JEE like JDBC and JMS
  41. 41. Resources JRuby www.jruby.org rubyforge.org/projects/jruby-extras JRuby Rails Integration www.headius.com/jrubywiki/index.php/Rails_Integration headius.blogspot.com/2006/11/advanced-rails-deployment-with-jruby.html RAD Spring Prototyping with JRuby thebogles.com/blog/projects/ruby-on-spring/ www.botspiritcompany.com/src/springruby/example_ruby_spring.html Chris Nelson’s Work mysterycoder.blogspot.com/2007/06/spring-jruby.html mysterycoder.blogspot.com/2007/06/include-spring.html
  42. 42. Books by Integrallis Yes, they are all Java books :-(
  43. 43. Thanks!
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×