Grails Integration Strategies
Upcoming SlideShare
Loading in...5
×
 

Grails Integration Strategies

on

  • 5,882 views

Slides from the Grails Integration Strategies BOF at JavaOne 2009. You can see these in context in a video shot by Bryan Williams of the Chicago Groovy User Group - http://cgug.blip.tv

Slides from the Grails Integration Strategies BOF at JavaOne 2009. You can see these in context in a video shot by Bryan Williams of the Chicago Groovy User Group - http://cgug.blip.tv

Statistics

Views

Total Views
5,882
Views on SlideShare
5,854
Embed Views
28

Actions

Likes
2
Downloads
72
Comments
0

3 Embeds 28

http://www.slideshare.net 23
http://www.linkedin.com 3
https://www.linkedin.com 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Grails Integration Strategies Grails Integration Strategies Presentation Transcript

  • Grails Enterprise Integration Strategies Dave Klein Contegix Beyond Managed Hosting
  • 2
  • Use the coupon code “javaone” for a 30% discount http://groovymag.com 3 View slide
  • Beta version available now at http://pragprog.com 4 View slide
  • Birds of a Feather 5
  • Grails [buzzword] [buzzword] Strategies What do we mean by Enterprise Integration? 6
  • 7
  • Java Enterprise Edition J E E 8
  • JEE JEE JEE JEE JEE JEE JEE 9
  • Why Bother? Why not leave well enough alone? 10
  • Grails: More Than Just a Cool Framework > Undeniable productivity gains > Built on top of proven technologies > Less code means less bugs > Allows you to embrace change > Reduce developer turnover (who would quit a Grails job?) > Simple and painless deployment 11
  • Itʼs a Really Cool Framework! 12
  • Integration Strategies > Calling EJB Session Beans from a Grails App • EJB 2 • EJB 3 > Accessing JNDI Resources from a Grails App • Using JNDI Datasources • Other JNDI Resources > Legacy Databases • GORM DSL • Annotations 13
  • Integration Strategies > Calling Grails Actions from Non-Grails Apps • From the server side using wget or curl • From the client using AJAX > Java Message Service > Reuse Existing Spring Beans > Reuse Existing Hibernate Entities > What else? 14
  • Calling an EJB 2 Session Bean From Grails In app/grails-app/conf/spring/resources.groovy beans = { ejbJndi(org.springframework.jndi.JndiTemplate){ environment = [ "java.naming.factory.initial":"weblogic.jndi.WLInitialContextFactory", "java.naming.provider.url" : "t3://some.enterprise.server:7001", "java.naming.security.principal" : "dave", "java.naming.security.credentials" : "1234" ] } empSession(org.springframework.ejb.access. SimpleRemoteStatelessSessionProxyFactoryBean){ jndiName = "EmpSession" businessInterface = "com.enterprise.some.ejb.session.EmpSession" jndiTemplate = ref("ejbJndi") } } 15
  • Calling an EJB 3 Session Bean From Grails In app/grails-app/conf/spring/resources.groovy beans = { ejbJndi(org.springframework.jndi.JndiTemplate){ environment = [ "java.naming.factory.initial" : "weblogic.jndi.WLInitialContextFactory", "java.naming.provider.url" : "t3://some.enterprise.server:7001" "java.naming.security.principal" : "dave", "java.naming.security.credentials" : "1234" ] } empSession(org.springframework.jndi.JndiObjectFactoryBean){ jndiName = "CoverageSession#org.foo.app.ejb.session.IEmpSessionRemote" jndiTemplate = ref("ejbJndi") } } 16
  • Integration Strategies > Calling EJB Session Beans from Grails Services • EJB 2 • EJB 3 > Accessing JNDI Resources from a Grails App • Using JNDI Datasources • Other JNDI Services > Legacy Databases • GORM DSL • Annotations 17
  • JNDI Datasources: Too Easy Not To Use In app/grails-app/conf/DataSource.groovy dataSource{ jndiName = “java:comp/env/jdbc/EnterpriseData” } Or in app/grails-app/conf/spring/resources.groovy beans = { dataSource(org.springframework.jndi.JndiObjectFactoryBean){ jndiName = “java:comp/env/jdbc/EnterpriseData” } } 18
  • Other JNDI Resources In app/grails-app/conf/spring/resources.groovy beans = { jndi(org.springframework.jndi.JndiTemplate){ environment = [ "java.naming.factory.initial" : "weblogic.jndi.WLInitialContextFactory", "java.naming.provider.url" : "t3://some.enterprise.server:7001" "java.naming.security.principal" : "dave", "java.naming.security.credentials" : "1234" ] } } 19
  • Integration Strategies > Calling EJB Session Beans from a Grails App • EJB 2 • EJB 3 > Accessing JNDI Resources from a Grails App • Using JNDI Datasources • Other JNDI Services > Legacy Databases • GORM DSL • Annotations 20
  • TABLE BK01 Column Name Date Type ID_BK_PK NUMBER BK_TITLE VARCHAR2(100) BK_AUTHOR VARCHAR2(100) BK_PGS NUMBER ID_PUB_FK NUMBER SEQUENCE ID_BK_PK_SEQ class Book { String title String author Integer pages Publisher publisher static belongsTo = Publisher static mapping = { table 'BK01' columns{ id column: 'ID_BK_PK' title column: 'BK_TITLE' author column: 'BK_AUTHOR' pages column: 'BK_PGS' publisher column: 'ID_PUB_FK' } id generator: 'sequence', params:[sequence:'ID_BK_PK_SEQ'] } } 21
  • @ Or you can use annotations (if you really want to) 22
  • Brief Tangent on How to Sneak Introduce Groovy and Grails Into The Enterprise > Unit Testing > Utility Scripts > Internal Web Applications > Prototypes > JDBC -> GSQL > XML Processing > Itʼs easier to get forgiveness than permission > Success Sells! 23
  • Integration Strategies > Calling Grails Actions from Non-Grails Apps • From the server side using wget or curl • From the client using AJAX > Java Message Service > Reuse Existing Spring Beans > Reuse Existing Hibernate Entities > What else? 24
  • > Calling Grails Actions from Non-Grails Apps > REST • URL Mapping DSL > SOAP • Plugins for XFire, Axis, SpringWS and more > Plain Old HTTP Call > Execute process in Grails > Return data - HTML, XML, JSON • Grails Converters are awesome! 25
  • Integration Strategies > Calling Grails Actions from Non-Grails Apps • From the server side using wget or curl • From the client using AJAX > Java Message Service > Reuse Existing Spring Beans > Reuse Existing Hibernate Entities > What else? 25 26
  • Dave Klein dave.klein@contegix.com Blog: dave-klein.blogspot.com Twitter: daveklein