• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
JRuby - Programmer's Best Friend on JVM
 

JRuby - Programmer's Best Friend on JVM

on

  • 1,598 views

Presentation at Java Day Riga 2012 conference

Presentation at Java Day Riga 2012 conference

Statistics

Views

Total Views
1,598
Views on SlideShare
1,546
Embed Views
52

Actions

Likes
3
Downloads
11
Comments
1

5 Embeds 52

https://twitter.com 41
https://si0.twimg.com 6
http://twitter.com 3
http://tweetedtimes.com 1
http://www.kred.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • On slide 27, there's a typo in the superclass of the CreatePosts - ActiveRecor - 'd' is missing.

    Does this make me a better JRuby'ist? :-)
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    JRuby - Programmer's Best Friend on JVM JRuby - Programmer's Best Friend on JVM Presentation Transcript

    • Programmer’s Best Friend on JVM Raimonds Simanovskis
    • @rsim github.com/rsimRaimonds Simanovskis
    • The easiest Business Intelligence tool on the Web
    • What isRuby?
    • object-oriented dynamic programming language simple from outside YukihiroMatsumotoor “Matz” powerful inside
    • Classes
    • Single Inheritance
    • Constructor
    • No Type Declarations
    • Instance Variables
    • Last expression isalways return value
    • .new is just a class method
    • Blocks / ClosuresAnonymous function as argument
    • Modules
    • Metaprogramming
    • Classes/Modules are open
    • Integration with Java Embed JRuby as scripting engine Use Java classes from JRuby
    • Embed JRuby
    • Embed JRuby
    • Use Java classes from JRuby Demo
    • Build with Rake
    • Test with Test::Unit or RSpec
    • Test with Test::Unit or RSpec
    • Ruby on RailsWeb applications development frameworkModel View Controller (MVC) architecture Convention over Configuration Don’t Repeat Yourself (DRY) Focused on developer productivity Agile software development approach
    • MVC Architecture Request Router Database SQLBrowser Response Action Active Controller RecordAction View
    • ActiveRecord (Model)class CreatePosts < ActiveRecor::Migration def self.up create_table :posts do |t| CREATE TABLE posts ( t.string :title id NUMBER(38) NOT t.text :body NULL, t.timestamps title VARCHAR2(255), end body CLOB, end created_at DATE,end updated_at DATE ); CREATE SEQUENCE posts_seq;class Post < ActiveRecord::Base # nothing here!endpost = Post.newpost.title = "First post"post.savepost = Post.find(1)puts post.name # output: "First post"
    • ActionControllerclass PostsController < ApplicationController # GET /posts def index @posts = Post.all end # GET /posts/1 def show @post = Post.find(params[:id]) end # GET /posts/new def new @post = Post.new end # ...end
    • ActionView<h1>Posts</h1><% @posts.each do |post| %> <h2><%= post.title %></h2> <h3>Created at <%= post.created_at %></h3> <p><%= post.body %></p><% end %>
    • JRuby deployment <insert app server here> Java app sever Application WAR fileApplication JRuby Gems warbler source Application
    • JRuby deployment Web Server Trinidad JRuby Apache Tomcat GemsApplication deploy Application source
    • JRuby deployment
    • eazyBI case study .com Ruby on Rails Jetty JRuby application deploy Application GemsMondrian OLAP engineApache Batik SVG toolkit pac Private kag e package Packaged application pluginOSGi bundle Application GemsJRuby jruby-rack *.jar Application Gems SQL Server
    • JRuby 1.7 and Java 7 invokedynamic
    • Ruby method calls
    • Ruby method calls
    • Ruby method calls
    • Ruby method calls
    • Ruby method calls
    • JRuby performance improvements JRuby/Java 6 JRuby/Java 7 Times Faster than Ruby 1.9.3 5 4.226 4.323.75 3.66 3.44 2.5 2.658 1.914 1.806 1.538 1.5651.25 1.346 0 base64 richards neural mandelbrot redblack
    • JRuby BenefitsEasy to learn for Java programmers Easy to mix Ruby and Java Useful frameworks and librariesHigher productivity for many tasks Ruby community