Top Banner
Björn Beskow | [email protected] | 20130116 Groovy & Grails 2.x update
88

Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

Dec 01, 2018

Download

Documents

trinhhanh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

Björn  Beskow  |  [email protected]  |  2013-­‐01-­‐16

Groovy  &  Grails  2.x  update

Page 2: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update

Agenda

2

• What’s  new  in  Groovy  2?• What’s  new  in  Grails  2.2?• Grails  Advanced  Enterprise  IntegraJons  through  examples

Page 3: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update

Groovy

3

• Groovy  is  a  dynamic language  on  and  for  the  JVM–Fully  interoperable  with  Java  at  all  levels

• Goal  is  to  greatly simplify the life for developers

• Release 2.0.6, December 2012 (started in 2004)

Page 4: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

• Full  Stack,  Full  Produc7vity  MVC  Framework• Built  on  a  solid,  well-­‐known  founda7on–Spring,  Hibernate,  Sitemesh

• ConvenJons  and  defaults  everywhere

• Release  2.2.0,  December  2012  (started  mid  2005)

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update

Grails

4

Page 5: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update

Protect  investment  in  the  JavaEE  platform

JDBC

JNDI

5

• ExisJng  applicaJons• ExisJng  APIs• ExisJng  3rd  party  components• ExisJng  competence

Page 6: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update

Groovy  &  Grails  1.x,  2011:What  was  the  problem?

6

Page 7: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update

Groovy  1.x,  2011:  What  was  the  problem?

7

•Dynamic  languagues  are  scary!•Dynamic  languages  are  slow!

Page 8: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update

Grails  1.x,  2011:  What  was  the  problem?

8

• Immature  Development  environment–  Bad  IDE  support–  Bad  build  system  support–  PrimiJve  dependency  management

Page 9: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update

Grails  1.x,  2011:  What  was  the  problem?

9

•Not  well  suited  for  test-­‐driven  development–  Old-­‐school  unit  test  framework–  Long  round-­‐trip  startup  Jme

Page 10: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update

Grails  1.x,  2011:  What  was  the  problem?

10

• Immature  plugins

Page 11: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update

 ...  but  things  change  ...

11

Page 12: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update12

Page 13: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update13

Page 14: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update14

Page 15: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update15

Page 16: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update16

Page 17: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update17

Page 18: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update18

Page 19: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update19

Page 20: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update20

Page 21: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update21

Groovy,  anno  2013

Page 22: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update22

Groovy  AST  transformations

Also  known  as  compile-­‐.me  metaprogramming

@@

Page 23: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update23

AST  transformations:  @Singleton

@Singleton(lazy = true)class MyClass {}

MyClass.instance.someMethod()

Page 24: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update24

AST  transformations:  @Lazy

class Person {

@Lazy List dnaProfile = { /* complex

computation */ }

}

Page 25: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update25

AST  transformations:  @Immutable@Immutablefinal class Coordinates {

Double latitude, longitude

}

Page 26: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update26

AST  transformations:  @Delegate

class Event {

@Delegate Date when …

}

def cadec = new Event(…)

def javaOne = new Event(…)

assert cadec.before(javaOne.when)

Page 27: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update27

AST  transformations:  @Log

@Logclass Employee {

Employee() {

log.info("Employee created")

}

}

Page 28: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update28

AST  transformations:  @AutoClone

@AutoCloneclass Employee {

String firstName

String lastName

Assignment assignment

}

Page 29: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update29

AST  transformations:  @ToString

@ToStringclass Employee {

String firstName

String lastName

}

def e = new Employee(firstName:”Björn”,lastName:”Beskow”)

assert e.toString == "Employee(Björn, Beskow)"

Page 30: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update30

AST  transformations:  @EqualsAndHashCode@EqualsAndHashCodeclass Employee {

String firstName

String lastName

Assignment assignment

}

Page 31: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update31

AST  transformations:  @InheritConstructors

@InheritConstructorsclass EmployeeException extends Exception {

EmployeeException(Assignment a) {..}

}

Page 32: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update32

AST  transformations:  @Category

@Category(Number)class NumberCategory {

Distance getMeters() {

new Distance(number: this)

}

}

use(NumberCategory) {

def dist = 300.meters

}

Page 33: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update

AST  transformations:  @TypeChecked

33

•Best  of  two  worlds:  –  Brings  Sta$c  Typing  into  the  dynamic  world  of  Groovy

•Compiler  performs  sophisJcated  type  inference

Page 34: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update34

Page 35: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update

AST  transformations:  @CompileStatic

35

•One  step  further:  –Sta.cally  compile  a  class  or  block  of  code,  which  makes  the  bytecode  (almost)  idenJcal  to  corresponding  compiled  Java  code,  with  iden.cal  performance–Can  prevent  dynamic  behavior  to  be  inadvertently  applied  to  a  block  of  code  (a.k.a.  “Monkey  Patching”)

Page 36: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update36

Grails,  anno  2013

Page 37: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update

Grails,  anno  2013

37

• IDE  support  that  finally  works• Many  high  quality  enterprise-­‐grade  plugins  available• Grails  2.2–Agent-­‐based  class  reloading  and  interacJve  console–NaJve  Maven  support–NoSQL  database  support–DB  MigraJons–Cloud  Deployments

Page 38: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update38

IDE  support

Page 39: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update39

Maven  integration  &  dependency  mgmt.

Page 40: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update40

TDD  support

Page 41: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update41

Page 42: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update

Grails:  The  Power  of  Convention

Serv ice View

Domain Class

Controller

42

Page 43: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update

Grails  Plugins

43

• Grails  Plugins  turn  Grails  into  an  extensible  pla4orm–Exposes  well-­‐defined  extension  points–Low  ceremony  format  makes  wriJng  plugins  trivial–AcJve  community,  with  well  over  800  plugins  available

Page 44: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update44

Page 45: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update

Plugins  in  action!

45

• DB  migraJons  with  Liquibase

• Cloud  deployment  to  Cloud  Foundry

• MongoDB  integraJon

• Db-­‐backed  message  translaJons

• Ajax-­‐based  Compass/Lucene  search

• LDAP-­‐based  authorizaJon

• Audit  logging

• ApplicaJon  monitoring

• Quartz  integraJon

• Mail  integraJon

• JMS  integraJon

• Spring  RemoJng  with  rich  clients

• RESTful  web  services

• SOAP  web  services

Page 46: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update

Quiz:  How  many  lines  of  code?

46

• 30  lines?

• 75  lines?

• 150  lines?

• 750  lines?

Page 47: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update47

Database  migrations

Page 48: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update48

Page 49: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update49

One-­‐click  Cloud  Deployment

Page 50: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update50

Page 51: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update51

NoSQL  Database  support

Page 52: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update52

NoSQL  Database  support

Page 53: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update53

Page 54: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update54

I18n

Page 55: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update55

I18n

Page 56: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update56

I18n

Page 57: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update57

Page 58: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update58

Searching

Page 59: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update59

Page 60: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update60

Ajax-­‐based  incremental  searching

Page 61: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update61

Authentication

Page 62: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update62

Page 63: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update63

Audit  Logging

Page 64: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update64

Page 65: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update65

Monitoring

Page 66: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update66

Page 67: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update67

Scheduling

Page 68: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update68

Scheduling

Page 69: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update69

Scheduling

Page 70: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update70

Mail

Page 71: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update71

Mail

Page 72: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update72

Page 73: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update73

JMS

Page 74: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update74

JMS

Page 75: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update75

JMS

Page 76: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update76

JMS

Page 77: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update77

Remoting

Page 78: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update78

Page 79: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update79

Restful  Web  Services

Page 80: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update80

Page 81: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update81

Restful  Web  Services

Page 82: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update82

Page 83: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update83

SOAP  Web  Services

Page 84: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update84

SOAP  Web  Services

Page 85: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update

Plugins  used  (grails.org/plugins)

85

• build-­‐test-­‐data• fixtures• auto-­‐test• database-­‐migraJon• cloud-­‐foundry• mongodb• searchable• localizaJons• spring-­‐security-­‐core,spring-­‐security-­‐ldap

• audit-­‐logging• app-­‐info,app-­‐info-­‐hibernate

• quartz,  quartz-­‐monitor• mail• jms• remoJng• json-­‐rest-­‐api• axis2

Page 86: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update

Quiz:  How  many  lines  of  code?

86

• MigraJons:  1  line

• CloudForge  deploy:  1  line

• MongoDB:  2  lines

• I18n:  1  line

• Searching:  2  lines

• Ajax-­‐based  search:  16  lines

• LDAP  auth:  5

• Audit  logging:  2  lines

• AppServer  monitoring:    2  lines

• Quartz  scheduling:  11  lines

• SMTP  mail:  6  lines

• JMS  sender:  7  lines

• JMS  message-­‐driven  service:  9  lines

• RemoJng:  2  lines

• Rest-­‐API:  2  lines

• Rest-­‐based  controller:  4  lines

• Axis2  service:  2  line

• Total:  75  lines

Page 87: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update

Conclusions

87

• Groovy  &  Grails  provides  an  extremely  producJve  extension  to  Java  &  JavaEE•Many  shortcomings  in  the  tooling  and  plugins  pornolio  have  been  addressed  recently–remains  to  be  seen  if  it  is  enough  to  lead  to  more  general  adopJon

Page 88: Groovy&&&Grails2.x&update - Callista Enterprisecallistaenterprise.se/.../presentationer/cadec-2013-groovy-grails.pdf · Groovy&Grails2.xupdate ©&2013&CallistaEnterprise&|& Agenda

©  2013  Callista  Enterprise  |  www.callistaenterprise.seGroovy  &  Grails  2.x  update

Questions

88