SlideShare une entreprise Scribd logo
1  sur  47
Télécharger pour lire hors ligne
O melhor dos dois mundos

  Creative  Commons  BY-­SA  3.0




Saturday, July 23, 2011
@abstractj

            Java há 12 anos, Ruby n00b
            TorqueBox Contributor
            Instrutor Caelum


Saturday, July 23, 2011
DISCLAIMER



Saturday, July 23, 2011
Java



      Come to the dark side

Saturday, July 23, 2011
ENTERPRISE



Saturday, July 23, 2011
JAXR                        Java-FX     JAXP
                          JSTL                         StAX JME
                                 JDOM       JVM
          JAX-RPC                                    EJB
                                             AWT           JMX
                  Swing
      EAR Struts          JAAS                       JCP
                 JavaBean
         NPE                                               Spring
     JAX-WS                 ENTERPRISE                       RMI
           JSE              JNI     JEE      SOA       NIO
                                                              JSP
       JSF JAXB   WAR  JNDI JDO
   JAX-RS JPQL EJBQL  JAF      POJO
                           JRE


Saturday, July 23, 2011
Saturday, July 23, 2011
Mas escala né?!



Saturday, July 23, 2011
Server Side



Saturday, July 23, 2011
JBoss
      Tomcat + Infinispan + HornetQ + Quartz + Clustering




Saturday, July 23, 2011
Hot Deployment



Saturday, July 23, 2011
Scala            Clojure
                                  Python


                                   JVM
                                   Ruby
            JavaScript                     Groovy




Saturday, July 23, 2011
Ruby
      Mais expressiva que Java




Saturday, July 23, 2011
DRY


Saturday, July 23, 2011
JRuby
                          Java + Ruby




Saturday, July 23, 2011
“You get true multithreading that
                 can use all your computer’s cores
                 from one process, plus a virtual
                 machine that’s been tuned for a
                 decade and a half.”

                             Using JRuby - Bringing Ruby to Java




Saturday, July 23, 2011
TorqueBox
                          “The power of JBoss with the
                            expressiveness of Ruby”
                                      Jim Crossley - MagicRuby Conference




Saturday, July 23, 2011
TorqueBox




Saturday, July 23, 2011
Instalação
                           TorqueBox do zero




Saturday, July 23, 2011
➜ jruby -S gem install torquebox torquebox-capistrano-support




Saturday, July 23, 2011
➜ wget http://torquebox.org/builds/LATEST/torquebox-dist-
      bin.zip
      ➜ unzip torquebox-dist-bin.zip

      ➜ export TORQUEBOX_HOME=$PWD/torquebox-1.x
      ➜ export JBOSS_HOME=$TORQUEBOX_HOME/jboss
      ➜ export JRUBY_HOME=$TORQUEBOX_HOME/jruby

      ➜ export PATH=$JRUBY_HOME/bin:$PATH




Saturday, July 23, 2011
Estrutura
      Diretórios do TorqueBox




Saturday, July 23, 2011
Rails
      rails new bazinga -m $TORQUEBOX_HOME/share/rails/template.rb




Saturday, July 23, 2011
Rake tasks
      rake torquebox:deploy
      rake torquebox:undeploy
      rake torquebox:run




Saturday, July 23, 2011
Deployment
                          Make knobs, not WAR!




Saturday, July 23, 2011
bazinga-knob.yml
      application:
       root: /home/bruno/app/bazinga
       env: development




Saturday, July 23, 2011
Scheduling
                          Agendamento de Jobs




Saturday, July 23, 2011
../app/jobs
      class JobDemo

         def initialize
          #Codigo de inicializacao
         end

       def run
        # O que você quer executar
       end
      end


Saturday, July 23, 2011
../config/torquebox.yml
      jobs:
       sync_agenda:
        job: JobDemo
        cron: '0 0 12 * * ?'
      end




Saturday, July 23, 2011
Mensageria
      Java Messaging Service + HornetQ




Saturday, July 23, 2011
Tasks
      class EmailerTask < TorqueBox::Messaging::Task
       def send_welcome(payload)
        to = "#{payload[:name]} <#{payload[:address]}>"
        # send welcome email to the user
       end
      end




Saturday, July 23, 2011
Tasks
      class UserController < ApplicationController
       def register
        user = User.new(params[:user])

        EmailerTask.async(:send_welcome, :address =>
      user.email, :name => user.name)
       end
      end




Saturday, July 23, 2011
messaging.yml
      /topics/print: PrintHandler
      /queues/students:
        PrintHandler:
         config:
          color: true




Saturday, July 23, 2011
Processors
      include TorqueBox::Messaging

      class PrintHandler < MessageProcessor
        def on_message(body)
          puts "Processing #{body} of #{message}"
        end
        def configure(opts)
          @color = opts['color']
        end
      end




Saturday, July 23, 2011
Queues
      include TorqueBox
      req = Messaging::Queue.new '/queues/questions'
      res = Messaging::Queue.new '/queues/answers'
       
      Thread.new do
        req.publish "What time is it?"
        puts res.receive( :timeout => 1000 )
      end
       
      puts req.receive
      res.publish Time.now




Saturday, July 23, 2011
Serviços



Saturday, July 23, 2011
class BazingaService
       def initialize
        @queue = Messaging::Queue.new(“bazinga”)
       end
       def start
        @queue.publish “Testing”
       end

       def stop
        # O que fazer quando o serviço receber um stop
       end
      end




Saturday, July 23, 2011
CDI - Simplificado
                             Injeção de dependências




Saturday, July 23, 2011
Java
      package com.gurusp;

      public class Bazinga {
        //gets e sets
        public void say(String message) { // Execução do método }
      }

      Deploy do jar na aplicação
      app/
      models/
      views/
      controllers/
      lib/bazinga.jar




Saturday, July 23, 2011
Ruby
     class BazingaController < ApplicationController

           include TorqueBox::Injectors

           def create
            bazinga = inject(com.gurusp.Bazinga )
            bazinga.say “Ruby is for Java”
           end

     end




Saturday, July 23, 2011
Caching
      class BeersController < ApplicationController

         caches_action :most_popular, :expires_in => 30.seconds

         def most_popular
          @popular_beers = Beer.most_popular(:limit => 25)
         end

      end




Saturday, July 23, 2011
Saturday, July 23, 2011
Clustering
      ➜ $JBOSS_HOME/bin/run.sh -c all




Saturday, July 23, 2011
Cache distribuído!



Saturday, July 23, 2011
BackStage




Saturday, July 23, 2011
Comunidade
            irc.freenode.net #torquebox
            http://torquebox.org
            http://github.com/torquebox
            twitter: @torquebox

Saturday, July 23, 2011
Obrigado!
                                    @abstractj




  Creative  Commons  BY-­SA  3.0




Saturday, July 23, 2011

Contenu connexe

Tendances

TorqueBox for Rubyists
TorqueBox for RubyistsTorqueBox for Rubyists
TorqueBox for Rubyistsbobmcwhirter
 
TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011Lance Ball
 
Using Java from Ruby with JRuby IRB
Using Java from Ruby with JRuby IRBUsing Java from Ruby with JRuby IRB
Using Java from Ruby with JRuby IRBHiro Asari
 
JUDCon 2010 Boston : TorqueBox
JUDCon 2010 Boston : TorqueBoxJUDCon 2010 Boston : TorqueBox
JUDCon 2010 Boston : TorqueBoxmarekgoldmann
 
ZK_Arch_notes_20081121
ZK_Arch_notes_20081121ZK_Arch_notes_20081121
ZK_Arch_notes_20081121WANGCHOU LU
 
Connecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyConnecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyNick Sieger
 
JUDCon 2010 Boston : BoxGrinder
JUDCon 2010 Boston : BoxGrinderJUDCon 2010 Boston : BoxGrinder
JUDCon 2010 Boston : BoxGrindermarekgoldmann
 
JRuby in Java Projects
JRuby in Java ProjectsJRuby in Java Projects
JRuby in Java Projectsjazzman1980
 
Torquebox OSCON Java 2011
Torquebox OSCON Java 2011Torquebox OSCON Java 2011
Torquebox OSCON Java 2011tobiascrawley
 
The Enterprise Strikes Back
The Enterprise Strikes BackThe Enterprise Strikes Back
The Enterprise Strikes BackBurke Libbey
 
Spring into rails
Spring into railsSpring into rails
Spring into railsHiro Asari
 
Torquebox @ Raleigh.rb - April 2011
Torquebox @ Raleigh.rb - April 2011Torquebox @ Raleigh.rb - April 2011
Torquebox @ Raleigh.rb - April 2011tobiascrawley
 
The Enterprise Strikes Back
The Enterprise Strikes BackThe Enterprise Strikes Back
The Enterprise Strikes BackBurke Libbey
 
Charla ruby nscodermad
Charla ruby nscodermadCharla ruby nscodermad
Charla ruby nscodermadnscoder_mad
 
Java7 - Top 10 Features
Java7 - Top 10 FeaturesJava7 - Top 10 Features
Java7 - Top 10 FeaturesAndreas Enbohm
 

Tendances (20)

TorqueBox for Rubyists
TorqueBox for RubyistsTorqueBox for Rubyists
TorqueBox for Rubyists
 
TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011TorqueBox - Ruby Hoedown 2011
TorqueBox - Ruby Hoedown 2011
 
JRuby and You
JRuby and YouJRuby and You
JRuby and You
 
Using Java from Ruby with JRuby IRB
Using Java from Ruby with JRuby IRBUsing Java from Ruby with JRuby IRB
Using Java from Ruby with JRuby IRB
 
JUDCon 2010 Boston : TorqueBox
JUDCon 2010 Boston : TorqueBoxJUDCon 2010 Boston : TorqueBox
JUDCon 2010 Boston : TorqueBox
 
ZK_Arch_notes_20081121
ZK_Arch_notes_20081121ZK_Arch_notes_20081121
ZK_Arch_notes_20081121
 
Connecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRubyConnecting the Worlds of Java and Ruby with JRuby
Connecting the Worlds of Java and Ruby with JRuby
 
JUDCon 2010 Boston : BoxGrinder
JUDCon 2010 Boston : BoxGrinderJUDCon 2010 Boston : BoxGrinder
JUDCon 2010 Boston : BoxGrinder
 
JRuby in Java Projects
JRuby in Java ProjectsJRuby in Java Projects
JRuby in Java Projects
 
Torquebox OSCON Java 2011
Torquebox OSCON Java 2011Torquebox OSCON Java 2011
Torquebox OSCON Java 2011
 
The Enterprise Strikes Back
The Enterprise Strikes BackThe Enterprise Strikes Back
The Enterprise Strikes Back
 
Spring into rails
Spring into railsSpring into rails
Spring into rails
 
Torquebox @ Raleigh.rb - April 2011
Torquebox @ Raleigh.rb - April 2011Torquebox @ Raleigh.rb - April 2011
Torquebox @ Raleigh.rb - April 2011
 
The Enterprise Strikes Back
The Enterprise Strikes BackThe Enterprise Strikes Back
The Enterprise Strikes Back
 
Charla ruby nscodermad
Charla ruby nscodermadCharla ruby nscodermad
Charla ruby nscodermad
 
First Day With J Ruby
First Day With J RubyFirst Day With J Ruby
First Day With J Ruby
 
Ruby 2.4 Internals
Ruby 2.4 InternalsRuby 2.4 Internals
Ruby 2.4 Internals
 
Hybrid Applications
Hybrid ApplicationsHybrid Applications
Hybrid Applications
 
Scala
ScalaScala
Scala
 
Java7 - Top 10 Features
Java7 - Top 10 FeaturesJava7 - Top 10 Features
Java7 - Top 10 Features
 

Similaire à Torquebox - O melhor dos dois mundos

NodeJS, CoffeeScript & Real-time Web
NodeJS, CoffeeScript & Real-time WebNodeJS, CoffeeScript & Real-time Web
NodeJS, CoffeeScript & Real-time WebJakub Nesetril
 
Towards a software ecosystem for java prolog interoperabilty
Towards a software ecosystem for java prolog interoperabiltyTowards a software ecosystem for java prolog interoperabilty
Towards a software ecosystem for java prolog interoperabiltykim.mens
 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevMattias Karlsson
 
Clojure for Java developers
Clojure for Java developersClojure for Java developers
Clojure for Java developersJohn Stevenson
 
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...Paul King
 
Jruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaJruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaKeith Bennett
 
Практики применения JRuby
Практики применения JRubyПрактики применения JRuby
Практики применения JRuby.toster
 
Clojure made-simple - John Stevenson
Clojure made-simple - John StevensonClojure made-simple - John Stevenson
Clojure made-simple - John StevensonJAX London
 
Clojure Fundamentals Course For Beginners
Clojure Fundamentals Course For Beginners Clojure Fundamentals Course For Beginners
Clojure Fundamentals Course For Beginners Paddy Lock
 
What python can learn from java
What python can learn from javaWhat python can learn from java
What python can learn from javajbellis
 
RxJS101 - What you need to know to get started with RxJS tomorrow
RxJS101 - What you need to know to get started with RxJS tomorrowRxJS101 - What you need to know to get started with RxJS tomorrow
RxJS101 - What you need to know to get started with RxJS tomorrowViliam Elischer
 
The Mayans Lost Guide to RxJava on Android
The Mayans Lost Guide to RxJava on AndroidThe Mayans Lost Guide to RxJava on Android
The Mayans Lost Guide to RxJava on AndroidFernando Cejas
 
I know why your Java is slow
I know why your Java is slowI know why your Java is slow
I know why your Java is slowaragozin
 
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011Nick Sieger
 
Deployment presentation
Deployment presentationDeployment presentation
Deployment presentationCorey Purcell
 
Devon 2011-f-4-improve your-javascript
Devon 2011-f-4-improve your-javascriptDevon 2011-f-4-improve your-javascript
Devon 2011-f-4-improve your-javascriptDaum DNA
 

Similaire à Torquebox - O melhor dos dois mundos (20)

NodeJS, CoffeeScript & Real-time Web
NodeJS, CoffeeScript & Real-time WebNodeJS, CoffeeScript & Real-time Web
NodeJS, CoffeeScript & Real-time Web
 
Towards a software ecosystem for java prolog interoperabilty
Towards a software ecosystem for java prolog interoperabiltyTowards a software ecosystem for java prolog interoperabilty
Towards a software ecosystem for java prolog interoperabilty
 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from Oredev
 
Clojure for Java developers
Clojure for Java developersClojure for Java developers
Clojure for Java developers
 
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
Industrial Strength Groovy - Tools for the Professional Groovy Developer: Pau...
 
Jruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-javaJruby synergy-of-ruby-and-java
Jruby synergy-of-ruby-and-java
 
Практики применения JRuby
Практики применения JRubyПрактики применения JRuby
Практики применения JRuby
 
Clojure made-simple - John Stevenson
Clojure made-simple - John StevensonClojure made-simple - John Stevenson
Clojure made-simple - John Stevenson
 
Upgrading to Rails 3
Upgrading to Rails 3Upgrading to Rails 3
Upgrading to Rails 3
 
Clojure Fundamentals Course For Beginners
Clojure Fundamentals Course For Beginners Clojure Fundamentals Course For Beginners
Clojure Fundamentals Course For Beginners
 
What python can learn from java
What python can learn from javaWhat python can learn from java
What python can learn from java
 
Einführung in Node.js
Einführung in Node.jsEinführung in Node.js
Einführung in Node.js
 
RxJS101 - What you need to know to get started with RxJS tomorrow
RxJS101 - What you need to know to get started with RxJS tomorrowRxJS101 - What you need to know to get started with RxJS tomorrow
RxJS101 - What you need to know to get started with RxJS tomorrow
 
The Mayans Lost Guide to RxJava on Android
The Mayans Lost Guide to RxJava on AndroidThe Mayans Lost Guide to RxJava on Android
The Mayans Lost Guide to RxJava on Android
 
I know why your Java is slow
I know why your Java is slowI know why your Java is slow
I know why your Java is slow
 
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
JRuby + Rails = Awesome Java Web Framework at Jfokus 2011
 
Play framework
Play frameworkPlay framework
Play framework
 
Play 2 pip
Play 2 pipPlay 2 pip
Play 2 pip
 
Deployment presentation
Deployment presentationDeployment presentation
Deployment presentation
 
Devon 2011-f-4-improve your-javascript
Devon 2011-f-4-improve your-javascriptDevon 2011-f-4-improve your-javascript
Devon 2011-f-4-improve your-javascript
 

Dernier

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 

Dernier (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 

Torquebox - O melhor dos dois mundos

  • 1. O melhor dos dois mundos Creative  Commons  BY-­SA  3.0 Saturday, July 23, 2011
  • 2. @abstractj Java há 12 anos, Ruby n00b TorqueBox Contributor Instrutor Caelum Saturday, July 23, 2011
  • 4. Java Come to the dark side Saturday, July 23, 2011
  • 6. JAXR Java-FX JAXP JSTL StAX JME JDOM JVM JAX-RPC EJB AWT JMX Swing EAR Struts JAAS JCP JavaBean NPE Spring JAX-WS ENTERPRISE RMI JSE JNI JEE SOA NIO JSP JSF JAXB WAR JNDI JDO JAX-RS JPQL EJBQL JAF POJO JRE Saturday, July 23, 2011
  • 10. JBoss Tomcat + Infinispan + HornetQ + Quartz + Clustering Saturday, July 23, 2011
  • 12. Scala Clojure Python JVM Ruby JavaScript Groovy Saturday, July 23, 2011
  • 13. Ruby Mais expressiva que Java Saturday, July 23, 2011
  • 15. JRuby Java + Ruby Saturday, July 23, 2011
  • 16. “You get true multithreading that can use all your computer’s cores from one process, plus a virtual machine that’s been tuned for a decade and a half.” Using JRuby - Bringing Ruby to Java Saturday, July 23, 2011
  • 17. TorqueBox “The power of JBoss with the expressiveness of Ruby” Jim Crossley - MagicRuby Conference Saturday, July 23, 2011
  • 19. Instalação TorqueBox do zero Saturday, July 23, 2011
  • 20. ➜ jruby -S gem install torquebox torquebox-capistrano-support Saturday, July 23, 2011
  • 21. ➜ wget http://torquebox.org/builds/LATEST/torquebox-dist- bin.zip ➜ unzip torquebox-dist-bin.zip ➜ export TORQUEBOX_HOME=$PWD/torquebox-1.x ➜ export JBOSS_HOME=$TORQUEBOX_HOME/jboss ➜ export JRUBY_HOME=$TORQUEBOX_HOME/jruby ➜ export PATH=$JRUBY_HOME/bin:$PATH Saturday, July 23, 2011
  • 22. Estrutura Diretórios do TorqueBox Saturday, July 23, 2011
  • 23. Rails rails new bazinga -m $TORQUEBOX_HOME/share/rails/template.rb Saturday, July 23, 2011
  • 24. Rake tasks rake torquebox:deploy rake torquebox:undeploy rake torquebox:run Saturday, July 23, 2011
  • 25. Deployment Make knobs, not WAR! Saturday, July 23, 2011
  • 26. bazinga-knob.yml application: root: /home/bruno/app/bazinga env: development Saturday, July 23, 2011
  • 27. Scheduling Agendamento de Jobs Saturday, July 23, 2011
  • 28. ../app/jobs class JobDemo def initialize #Codigo de inicializacao end def run # O que você quer executar end end Saturday, July 23, 2011
  • 29. ../config/torquebox.yml jobs: sync_agenda: job: JobDemo cron: '0 0 12 * * ?' end Saturday, July 23, 2011
  • 30. Mensageria Java Messaging Service + HornetQ Saturday, July 23, 2011
  • 31. Tasks class EmailerTask < TorqueBox::Messaging::Task def send_welcome(payload) to = "#{payload[:name]} <#{payload[:address]}>" # send welcome email to the user end end Saturday, July 23, 2011
  • 32. Tasks class UserController < ApplicationController def register user = User.new(params[:user]) EmailerTask.async(:send_welcome, :address => user.email, :name => user.name) end end Saturday, July 23, 2011
  • 33. messaging.yml /topics/print: PrintHandler /queues/students: PrintHandler: config: color: true Saturday, July 23, 2011
  • 34. Processors include TorqueBox::Messaging class PrintHandler < MessageProcessor   def on_message(body)     puts "Processing #{body} of #{message}"   end   def configure(opts)     @color = opts['color']   end end Saturday, July 23, 2011
  • 35. Queues include TorqueBox req = Messaging::Queue.new '/queues/questions' res = Messaging::Queue.new '/queues/answers'   Thread.new do   req.publish "What time is it?"   puts res.receive( :timeout => 1000 ) end   puts req.receive res.publish Time.now Saturday, July 23, 2011
  • 37. class BazingaService def initialize @queue = Messaging::Queue.new(“bazinga”) end def start @queue.publish “Testing” end def stop # O que fazer quando o serviço receber um stop end end Saturday, July 23, 2011
  • 38. CDI - Simplificado Injeção de dependências Saturday, July 23, 2011
  • 39. Java package com.gurusp; public class Bazinga { //gets e sets public void say(String message) { // Execução do método } } Deploy do jar na aplicação app/ models/ views/ controllers/ lib/bazinga.jar Saturday, July 23, 2011
  • 40. Ruby class BazingaController < ApplicationController include TorqueBox::Injectors def create bazinga = inject(com.gurusp.Bazinga ) bazinga.say “Ruby is for Java” end end Saturday, July 23, 2011
  • 41. Caching class BeersController < ApplicationController caches_action :most_popular, :expires_in => 30.seconds def most_popular @popular_beers = Beer.most_popular(:limit => 25) end end Saturday, July 23, 2011
  • 43. Clustering ➜ $JBOSS_HOME/bin/run.sh -c all Saturday, July 23, 2011
  • 46. Comunidade irc.freenode.net #torquebox http://torquebox.org http://github.com/torquebox twitter: @torquebox Saturday, July 23, 2011
  • 47. Obrigado! @abstractj Creative  Commons  BY-­SA  3.0 Saturday, July 23, 2011

Notes de l'éditeur

  1. Experi&amp;#xEA;ncia com TorqueBox\nMotiva&amp;#xE7;&amp;#xF5;es\nMostrar um pouco como funciona\n
  2. non experient\nveio a pedido do vinny e rinaldi pra ensinar jsf pra voces\nexperiencia real de ter que juntar os dois mundos\n
  3. \n
  4. Surgiu em 1995 e causa medo at&amp;#xE9; hoje\nM&amp;#xE9;rito da Burocracia\nmito/medo de que Java &amp;#xE9; dificil\n
  5. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  6. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  7. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  8. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  9. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  10. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  11. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  12. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  13. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  14. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  15. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  16. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  17. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  18. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  19. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  20. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  21. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  22. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  23. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  24. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  25. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  26. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  27. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  28. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  29. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  30. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  31. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  32. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  33. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  34. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  35. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  36. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  37. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  38. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  39. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  40. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  41. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  42. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  43. +5 anos de experi&amp;#xEA;ncia pra decorar acr&amp;#xF4;nimos\n
  44. \n
  45. \n
  46. WAS, glassfish, jboss. Necessidade de subir app java no mundo corp\n
  47. Enterprise the good parts. Apesar de todo buzzword existente no Java\nOs caras conseguiram juntar experiencia pra fazer coisas legais\nApresentar cada um\n
  48. \n
  49. Mesmo assim, come&amp;#xE7;aram a surgir v&amp;#xE1;rias linguagens em cima da vm\nAfinal, java nao resolve todos os problemas do mundo\nScala surgiu do descontentamento com java por exemplo\n
  50. Sintaxe mais clara, limpa. Expressiva\nProdutividade com rails\nBom, todo mundo aqui sabe que ruby &amp;#xE9; legal certo?\n
  51. Os problemas s&amp;#xE3;o os mesmos, resolvemos com nomes diferentes\nProblemas j&amp;#xE1; resolvidos: escalabilidade, mensageria, clustering, schedule...\nPorque n&amp;#xE3;o tirar proveito do java e do ruby?\n
  52. \n
  53. \n
  54. Criado em 2008\nPatrocinado pela RedHat\n
  55. \n
  56. \n
  57. \n
  58. \n
  59. \n
  60. \n
  61. \n
  62. \n
  63. \n
  64. \n
  65. \n
  66. O que &amp;#xE9; preciso fazer no servidor? NADA, ele nao exige redeploy\n
  67. \n
  68. Inspirado no DelayedJobs\n
  69. O que &amp;#xE9; preciso fazer no servidor? NADA, ele nao exige redeploy\n
  70. Inspirado no DelayedJobs\n
  71. \n
  72. \n
  73. \n
  74. O que &amp;#xE9; preciso fazer no servidor? NADA, ele nao exige redeploy\n
  75. \n
  76. \n
  77. \n
  78. \n
  79. \n
  80. \n
  81. \n
  82. \n
  83. \n
  84. \n