RAD with JBoss AS · RAD with JBoss AS Rails : Sinatra : Rack : Grails : Roo : ... –Unique...

18
RAD with JBoss AS Rails : Sinatra : Rack : Grails : Roo : Play! Monday, May 9, 2011

Transcript of RAD with JBoss AS · RAD with JBoss AS Rails : Sinatra : Rack : Grails : Roo : ... –Unique...

Page 1: RAD with JBoss AS · RAD with JBoss AS Rails : Sinatra : Rack : Grails : Roo : ... –Unique template system based on Groovy. ... •Remove slf4j-api-1.6.1.jar

RAD withJBoss AS

Rails : Sinatra : Rack : Grails : Roo : Play!

Monday, May 9, 2011

Page 2: RAD with JBoss AS · RAD with JBoss AS Rails : Sinatra : Rack : Grails : Roo : ... –Unique template system based on Groovy. ... •Remove slf4j-api-1.6.1.jar

Agenda

• Use Case Overview• Ruby - Lance• Grails - Marius• Roo - Marius• Play! - Burr

Monday, May 9, 2011

Page 3: RAD with JBoss AS · RAD with JBoss AS Rails : Sinatra : Rack : Grails : Roo : ... –Unique template system based on Groovy. ... •Remove slf4j-api-1.6.1.jar

Use Case

• Build a Twitter clone in 3 easy steps!• Write it in something other than Java• Deploy it

Monday, May 9, 2011

Page 4: RAD with JBoss AS · RAD with JBoss AS Rails : Sinatra : Rack : Grails : Roo : ... –Unique template system based on Groovy. ... •Remove slf4j-api-1.6.1.jar

TorqueBox + Ruby

• Ruby on JBoss AS6• Infinispan cache• Quartz scheduling• Tomcat web• HornetQ messaging• PicketBox authentication• mod_cluster clustering

Monday, May 9, 2011

Page 5: RAD with JBoss AS · RAD with JBoss AS Rails : Sinatra : Rack : Grails : Roo : ... –Unique template system based on Groovy. ... •Remove slf4j-api-1.6.1.jar

We’ve Got No Time, So What Do We Look At?

• Controller & routes: application.rb• Domain models: lib/chirp.rb• Views: views/layout.haml• Deployment: config/torquebox.yml• http://github.com/torquebox/chirpr

Monday, May 9, 2011

Page 6: RAD with JBoss AS · RAD with JBoss AS Rails : Sinatra : Rack : Grails : Roo : ... –Unique template system based on Groovy. ... •Remove slf4j-api-1.6.1.jar

Pros & Cons

Pros• You got your Java in my Ruby (CDI)

@bean = inject(‘SomeMCBean’)

• Large & growing Ruby community• YAML Deployment• Hot application reloading• Testing - test your Java code with Ruby• HAML + SASS • Dynamically typed

Monday, May 9, 2011

Page 7: RAD with JBoss AS · RAD with JBoss AS Rails : Sinatra : Rack : Grails : Roo : ... –Unique template system based on Groovy. ... •Remove slf4j-api-1.6.1.jar

Pros & Cons

Cons• Dynamically typed language• Different programming paradigm, e.g.

• Module mixins vs. class hierarchies• Code blocks

• Speed/Performance?

Monday, May 9, 2011

Page 8: RAD with JBoss AS · RAD with JBoss AS Rails : Sinatra : Rack : Grails : Roo : ... –Unique template system based on Groovy. ... •Remove slf4j-api-1.6.1.jar

Play! Framework

www.playframework.orgBurr Sutter – Sr Product

Manager, JBoss

Page 9: RAD with JBoss AS · RAD with JBoss AS Rails : Sinatra : Rack : Grails : Roo : ... –Unique template system based on Groovy. ... •Remove slf4j-api-1.6.1.jar

Pros & Cons• Pros:

– Java Language (as a dynamic language viaEclipse compiler)

– Edit, Save, Refresh – hot compile– Built-in Test harness – Unit, Functional, Selenium– RESTful Architecture– Custom Tags & Extensions

• Cons:– Less mature– Smaller community– Maven support is a recent addition (Ivy built-in)– Unique template system based on Groovy

Page 10: RAD with JBoss AS · RAD with JBoss AS Rails : Sinatra : Rack : Grails : Roo : ... –Unique template system based on Groovy. ... •Remove slf4j-api-1.6.1.jar

Play! on JBoss

• “play war –o \tmp\my.war”• jboss-web.xml• Deploy a Datasource• Tweak application.conf (datasource)• “XAResource” error – remove jta1.1.jar• Remove slf4j-api-1.6.1.jar• Add hibernate-validator-legacy.jar• Remove .settings, test-result, eclipse

Play 1.1.1

Page 11: RAD with JBoss AS · RAD with JBoss AS Rails : Sinatra : Rack : Grails : Roo : ... –Unique template system based on Groovy. ... •Remove slf4j-api-1.6.1.jar

Grails

(Née “Groovy on Rails”)

Page 12: RAD with JBoss AS · RAD with JBoss AS Rails : Sinatra : Rack : Grails : Roo : ... –Unique template system based on Groovy. ... •Remove slf4j-api-1.6.1.jar

Grails

• Convention-over-configuration web framework

• Dynamic language-based (Groovy)• Since 2006

Page 13: RAD with JBoss AS · RAD with JBoss AS Rails : Sinatra : Rack : Grails : Roo : ... –Unique template system based on Groovy. ... •Remove slf4j-api-1.6.1.jar

Technology

• Entity-Controller-View division– Entity: Hibernate (GORM)– Controller: Spring MVC– View: JSP/GSP

• Coding in Groovy• Plugins for extending functionality–Scripts for generating code

Page 14: RAD with JBoss AS · RAD with JBoss AS Rails : Sinatra : Rack : Grails : Roo : ... –Unique template system based on Groovy. ... •Remove slf4j-api-1.6.1.jar

Pros & Cons

• Pros– Concise (CoC + dynamic language)

–Mature (plugins)– JVM-based (investment reuse,

performance)

• Cons– Learning curve for specific constructs– Not easy to reverse action done by scripts– Non-transparent dependency bundling

Page 15: RAD with JBoss AS · RAD with JBoss AS Rails : Sinatra : Rack : Grails : Roo : ... –Unique template system based on Groovy. ... •Remove slf4j-api-1.6.1.jar

Spring Roo

`

(Kanga Roo)

Page 16: RAD with JBoss AS · RAD with JBoss AS Rails : Sinatra : Rack : Grails : Roo : ... –Unique template system based on Groovy. ... •Remove slf4j-api-1.6.1.jar

Spring Roo

• Productivity tool for Spring applications• Java-based– Focus on static typing

• No runtime components– Generates code, but has no libraries

• Command-line driven

Page 17: RAD with JBoss AS · RAD with JBoss AS Rails : Sinatra : Rack : Grails : Roo : ... –Unique template system based on Groovy. ... •Remove slf4j-api-1.6.1.jar

Changes needed?

• Code works out-of-the box

• Adding complex use cases require manual coding

• Persistence infrastructure is local– Can be changed to managed/JTA manually

• Dependencies need some adjustment• Suppress scanning

Page 18: RAD with JBoss AS · RAD with JBoss AS Rails : Sinatra : Rack : Grails : Roo : ... –Unique template system based on Groovy. ... •Remove slf4j-api-1.6.1.jar

Pros / Cons

• Pros– Fast generation of Spring configuration– Fast generation of entity & scaffolding code– Good separation of generated/custom code

• Cons– Less flexible infrastructure generation

• Exclusive focus on servlet containers

–More limited set of options and templates• Compared with Grails, for example