Grails Integration Strategies

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite

    Grails Integration Strategies - Presentation Transcript

    1. Grails Enterprise Integration Strategies Dave Klein Contegix Beyond Managed Hosting
    2. 2
    3. Use the coupon code “javaone” for a 30% discount http://groovymag.com 3
    4. Beta version available now at http://pragprog.com 4
    5. Birds of a Feather 5
    6. Grails [buzzword] [buzzword] Strategies What do we mean by Enterprise Integration? 6
    7. 7
    8. Java Enterprise Edition J E E 8
    9. JEE JEE JEE JEE JEE JEE JEE 9
    10. Why Bother? Why not leave well enough alone? 10
    11. 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
    12. Itʼs a Really Cool Framework! 12
    13. 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
    14. 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
    15. 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
    16. 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
    17. 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
    18. 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
    19. 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
    20. 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
    21. 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
    22. @ Or you can use annotations (if you really want to) 22
    23. 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
    24. 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
    25. > 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
    26. 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
    27. Dave Klein dave.klein@contegix.com Blog: dave-klein.blogspot.com Twitter: daveklein

    + davekleindaveklein, 4 months ago

    custom

    471 views, 1 favs, 0 embeds more stats

    Slides from the Grails Integration Strategies BOF a more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 471
      • 471 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 20
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Tags