SlideShare uma empresa Scribd logo
1 de 13
Baixar para ler offline
Why	
  Grails?	
  

  Yiguang	
  Hu	
  
What	
  is	
  Grails?	
  
•  Grails	
  is	
  a	
  web	
  framework	
  based	
  on	
  
    –  JAVA,	
  GROOVY,	
  Spring,	
  GORM	
  
•  Scaffolding!	
  
•  Plugin	
  everything!!!	
  
    –  GWT,	
  DWR,	
  YUI,	
  ACEGI,	
  Google	
  AppEngine,	
  Google	
  
       Wave,	
  COMET,	
  JQuery,	
  Clojure,	
  Scala,	
  JSF,	
  Struts…	
  
•  Support	
  all	
  modern	
  browsers	
  automaRcally	
  
•  Render	
  object	
  to	
  JSON,	
  XML	
  free!	
  
•  MVC+IOC(services)+plugin	
  
Why	
  Grails?	
  
•  Rapid	
  
    –  Have	
  your	
  next	
  Web	
  2.0	
  project	
  done	
  in	
  weeks	
  instead	
  of	
  
       months.	
  Grails	
  delivers	
  a	
  new	
  age	
  of	
  Java	
  web	
  applicaRon	
  
       producRvity.	
  
•  Dynamic	
  
    –  Get	
  instant	
  feedback,	
  see	
  instant	
  results.	
  Grails	
  is	
  the	
  
       premier	
  dynamic	
  language	
  web	
  framework	
  for	
  the	
  JVM.	
  
•  Robust	
  
    –  Powered	
  by	
  Spring,	
  Grails	
  out	
  performs	
  the	
  compeRRon.	
  
       Dynamic,	
  agile	
  web	
  development	
  without	
  compromises.	
  
•  Proven	
  Technologies:	
  JAVA(Groovy),	
  Spring,	
  GORM	
  
What	
  is	
  Groovy?	
  
•  Groovy	
  =	
  
    –  JAVA+Dynamic	
  Typing+Closure+	
  
        DSL,	
  GPars,Griffon….	
  
•  Runs	
  on	
  JVM	
  


• 0      	
  Learning	
  curve	
  for	
  Java	
  programmer	
  
Success	
  Stories	
  
•  The	
  Sites	
  I	
  personally	
  involved:	
  
    –  Worthpoint.com	
  (80	
  million	
  records)	
  
    –  Gsword:	
  h_p://www.ccimweb.org/gsword	
  
        •  Web	
  2.0.	
  Highly	
  interacRve.	
  
        •  Done	
  in	
  two	
  days!	
  
    –  Others	
  
Demo	
  
•  Install	
  java,	
  groovy,	
  grails	
  
•  grails	
  create-­‐app	
  interop	
  
    –  Goto	
  dir	
  interop	
  and	
  see	
  the	
  dires/files	
  created	
  
•  Run	
  it!	
  
•  Add	
  domain	
  
•  Generate	
  controller/views	
  and	
  run	
  
    –  SorRng,	
  paginaRon	
  are	
  there	
  already!	
  
•  Add	
  a	
  service	
  and	
  use	
  in	
  controller	
  
•  Run	
  it!	
  
Demo…	
  
•  SOA	
  
    –  Render	
  objects	
  as	
  JSON,	
  XML	
  etc	
  
    –  Import	
  grails.converters.*;	
  
•  Parallel	
  compuRng	
  in	
  Services	
  using	
  GPars	
  
•  Using	
  other	
  languages	
  like	
  Clojure	
  in	
  grails	
  
•  …	
  
Performance	
  Concern?	
  
•    User	
  Java	
  in	
  high	
  demanding	
  place	
  
•    Gpars	
  (Actors,	
  map	
  reducer…)	
  
•    Use	
  clojure	
  in	
  services	
  
•    User	
  Scala	
  in	
  services	
  

•  Yes.	
  It	
  is	
  AGILE!	
  
Clojure	
  Demo	
  
•  grails	
  install-­‐plugin	
  clojure	
  
•  New	
  dir	
  src/clj	
  is	
  created	
  
•  Add	
  file	
  Addnumber.clj	
  in	
  src/clj	
  
        (ns	
  grails)	
  
        (def	
  twenty	
  20)	
  
        (defn	
  add_numbers	
  [a	
  b]	
  
        	
  	
  	
  	
  (+	
  a	
  b))	
  
Call	
  Clojure	
  from	
  Service	
  
class	
  ClojService	
  {	
  
	
  	
  	
  	
  boolean	
  transacRonal	
  =	
  false	
  
	
  	
  	
  	
  def	
  addNumbers(x,	
  y)	
  {	
  
	
  	
  	
  	
  clj.add_numbers(x,	
  y)	
  
	
  	
  	
  	
  }	
  
	
  	
  	
  def	
  addTwenty(x)	
  {	
  
	
  	
  	
  clj.add_numbers(x,	
  clj.twenty)	
  
	
  	
  	
  }	
  
}	
  
Call	
  Service	
  in	
  Controller	
  
import	
  grails.converters.XML;	
  
class	
  PlayController	
  {	
  
	
  	
  	
  	
  def	
  index	
  =	
  {	
  }	
  
	
  	
  def	
  clojService	
  
def	
  cljaddnumber={	
  
	
  	
  	
  	
  	
  	
  	
  render	
  clojService.addNumbers(Integer.parseInt(params.a?:"5"),	
  
                        Integer.parseInt(params.b?:"4"))	
  
	
  	
  }	
  
	
  	
  def	
  cljadd20={	
  
	
  	
  	
  	
  render	
  clojService.addTwenty(Integer.parseInt(params.a?:"10"))	
  
	
  	
  }	
  
}	
  
Gpars	
  Map	
  Reducer	
  Demo	
  
//@Grab(group='org.codehaus.gpars',	
  module='gpars',	
  version='0.9')	
  
import	
  staRc	
  groovyx.gpars.Parallelizer.*	
  
class	
  ConcurrentService	
  {	
  
	
  	
  	
  	
  boolean	
  transacRonal	
  =	
  true	
  
	
  	
  	
  	
  def	
  sqr()	
  {	
  
	
  	
  	
  	
  	
  	
  def	
  myNumbers	
  
	
  	
  	
  	
  	
  	
  doParallel{	
  
	
  	
  	
  	
  	
  myNumbers	
  =	
  (1..1000).parallel.filter{it	
  %	
  2	
  ==	
  0}.map{Math.sqrt	
  
                        it}.collecRon	
  
	
  	
  	
  	
  	
  	
  }	
  
	
  	
  	
  	
  	
  	
  myNumbers	
  
	
  	
  	
  	
  }	
  
Gpars	
  Map	
  Reducer	
  Demo	
  
def	
  search(String	
  key,keys){	
  
	
  	
  	
  	
  	
  key+":"+	
  keys.replaceAll(key,key.toUpperCase())	
  	
  	
  	
  /turns	
  key	
  to	
  upper	
  case	
  
	
  	
  }	
  
	
  	
  def	
  webs=["a	
  b	
  c	
  d	
  e	
  f	
  g	
  h	
  j	
  k	
  i	
  o	
  as	
  da	
  o	
  sa	
  ds	
  h	
  vcx	
  aw	
  s	
  dsf	
  gdsg	
  	
  ds	
  ,	
  bbx	
  
                        fdwvcx	
  786	
  ",	
  "b	
  sd	
  sd	
  sd	
  dsfgh	
  fds	
  	
  ewr	
  56y	
  	
  k	
  o	
  aw	
  	
  n	
  q	
  	
  12	
  	
  g	
  	
  n	
  1	
  	
  	
  	
  	
  uy	
  t	
  r",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "sad	
  assa	
  sa	
  sa	
  sa	
  sa	
  456t465367	
  45	
  45	
  23	
  23	
  12	
  	
  	
  453	
  43	
  5	
  3	
  234	
  523	
  ",	
  
	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  "8sdf	
  ds	
  5ue	
  	
  we	
  	
  123	
  	
  42	
  hg	
  	
  h	
  k	
  	
  	
  s	
  x	
  d	
  f	
  	
  t	
  r	
  g	
  h	
  j	
  	
  y	
  k	
  v	
  	
  b	
  n	
  	
  m	
  l	
  qw	
  ew	
  c"]	
  
	
  	
  def	
  reducer(String	
  key)	
  {	
  
	
  	
  	
  	
  	
  	
  	
  def	
  rst	
  
	
  	
  	
  	
  doParallel	
  {	
  
rst	
  =	
  webs.parallel.map	
  {search(key,it)}.collecRon	
  
	
  	
  	
  	
  }	
  
	
  	
  	
  	
  rst	
  
	
  	
  }}	
  

Mais conteúdo relacionado

Mais procurados

Declarative Infrastructure Tools
Declarative Infrastructure Tools Declarative Infrastructure Tools
Declarative Infrastructure Tools Yulia Shcherbachova
 
2016 foss4 g track: developing and implementing spatial etl processes with...
2016 foss4 g track:  developing and implementing  spatial etl processes  with...2016 foss4 g track:  developing and implementing  spatial etl processes  with...
2016 foss4 g track: developing and implementing spatial etl processes with...GIS in the Rockies
 
Js interpreter interpreted
Js interpreter interpretedJs interpreter interpreted
Js interpreter interpretedMartha Schumann
 
Functional Programming with JavaScript
Functional Programming with JavaScriptFunctional Programming with JavaScript
Functional Programming with JavaScriptMark Shelton
 
Data structure programs in c++
Data structure programs in c++Data structure programs in c++
Data structure programs in c++mmirfan
 
Cassandra Day Denver 2014: Building Java Applications with Apache Cassandra
Cassandra Day Denver 2014: Building Java Applications with Apache CassandraCassandra Day Denver 2014: Building Java Applications with Apache Cassandra
Cassandra Day Denver 2014: Building Java Applications with Apache CassandraDataStax Academy
 
Cascadia.js: Don't Cross the Streams
Cascadia.js: Don't Cross the StreamsCascadia.js: Don't Cross the Streams
Cascadia.js: Don't Cross the Streamsmattpodwysocki
 
W3C HTML5 KIG-How to write low garbage real-time javascript
W3C HTML5 KIG-How to write low garbage real-time javascriptW3C HTML5 KIG-How to write low garbage real-time javascript
W3C HTML5 KIG-How to write low garbage real-time javascriptChanghwan Yi
 
RxJS - The Reactive extensions for JavaScript
RxJS - The Reactive extensions for JavaScriptRxJS - The Reactive extensions for JavaScript
RxJS - The Reactive extensions for JavaScriptViliam Elischer
 
Virtual machine and javascript engine
Virtual machine and javascript engineVirtual machine and javascript engine
Virtual machine and javascript engineDuoyi Wu
 
Metrics 2.0 @ Monitorama PDX 2014
Metrics 2.0 @ Monitorama PDX 2014Metrics 2.0 @ Monitorama PDX 2014
Metrics 2.0 @ Monitorama PDX 2014Dieter Plaetinck
 
Metrics 2.0 & Graph-Explorer
Metrics 2.0 & Graph-ExplorerMetrics 2.0 & Graph-Explorer
Metrics 2.0 & Graph-ExplorerDieter Plaetinck
 
How the Go runtime implement maps efficiently
How the Go runtime implement maps efficientlyHow the Go runtime implement maps efficiently
How the Go runtime implement maps efficientlyTing-Li Chou
 
TPC-DS performance evaluation for JAQL and PIG queries - Andrii Vozniuk, Serg...
TPC-DS performance evaluation for JAQL and PIG queries - Andrii Vozniuk, Serg...TPC-DS performance evaluation for JAQL and PIG queries - Andrii Vozniuk, Serg...
TPC-DS performance evaluation for JAQL and PIG queries - Andrii Vozniuk, Serg...Andrii Vozniuk
 
The Ring programming language version 1.5.4 book - Part 62 of 185
The Ring programming language version 1.5.4 book - Part 62 of 185The Ring programming language version 1.5.4 book - Part 62 of 185
The Ring programming language version 1.5.4 book - Part 62 of 185Mahmoud Samir Fayed
 
Nicety of java 8 multithreading for advanced, Max Voronoy
Nicety of java 8 multithreading for advanced, Max VoronoyNicety of java 8 multithreading for advanced, Max Voronoy
Nicety of java 8 multithreading for advanced, Max VoronoySigma Software
 

Mais procurados (20)

Declarative Infrastructure Tools
Declarative Infrastructure Tools Declarative Infrastructure Tools
Declarative Infrastructure Tools
 
2016 foss4 g track: developing and implementing spatial etl processes with...
2016 foss4 g track:  developing and implementing  spatial etl processes  with...2016 foss4 g track:  developing and implementing  spatial etl processes  with...
2016 foss4 g track: developing and implementing spatial etl processes with...
 
Js interpreter interpreted
Js interpreter interpretedJs interpreter interpreted
Js interpreter interpreted
 
Functional Programming with JavaScript
Functional Programming with JavaScriptFunctional Programming with JavaScript
Functional Programming with JavaScript
 
Single qubit-gates operations
Single qubit-gates operationsSingle qubit-gates operations
Single qubit-gates operations
 
Data structure programs in c++
Data structure programs in c++Data structure programs in c++
Data structure programs in c++
 
Cassandra Day Denver 2014: Building Java Applications with Apache Cassandra
Cassandra Day Denver 2014: Building Java Applications with Apache CassandraCassandra Day Denver 2014: Building Java Applications with Apache Cassandra
Cassandra Day Denver 2014: Building Java Applications with Apache Cassandra
 
201801 CSE240 Lecture 15
201801 CSE240 Lecture 15201801 CSE240 Lecture 15
201801 CSE240 Lecture 15
 
Presto in Treasure Data
Presto in Treasure DataPresto in Treasure Data
Presto in Treasure Data
 
Cascadia.js: Don't Cross the Streams
Cascadia.js: Don't Cross the StreamsCascadia.js: Don't Cross the Streams
Cascadia.js: Don't Cross the Streams
 
W3C HTML5 KIG-How to write low garbage real-time javascript
W3C HTML5 KIG-How to write low garbage real-time javascriptW3C HTML5 KIG-How to write low garbage real-time javascript
W3C HTML5 KIG-How to write low garbage real-time javascript
 
RxJS - The Reactive extensions for JavaScript
RxJS - The Reactive extensions for JavaScriptRxJS - The Reactive extensions for JavaScript
RxJS - The Reactive extensions for JavaScript
 
Virtual machine and javascript engine
Virtual machine and javascript engineVirtual machine and javascript engine
Virtual machine and javascript engine
 
Metrics 2.0 @ Monitorama PDX 2014
Metrics 2.0 @ Monitorama PDX 2014Metrics 2.0 @ Monitorama PDX 2014
Metrics 2.0 @ Monitorama PDX 2014
 
Metrics 2.0 & Graph-Explorer
Metrics 2.0 & Graph-ExplorerMetrics 2.0 & Graph-Explorer
Metrics 2.0 & Graph-Explorer
 
How the Go runtime implement maps efficiently
How the Go runtime implement maps efficientlyHow the Go runtime implement maps efficiently
How the Go runtime implement maps efficiently
 
TPC-DS performance evaluation for JAQL and PIG queries - Andrii Vozniuk, Serg...
TPC-DS performance evaluation for JAQL and PIG queries - Andrii Vozniuk, Serg...TPC-DS performance evaluation for JAQL and PIG queries - Andrii Vozniuk, Serg...
TPC-DS performance evaluation for JAQL and PIG queries - Andrii Vozniuk, Serg...
 
Metrics stack 2.0
Metrics stack 2.0Metrics stack 2.0
Metrics stack 2.0
 
The Ring programming language version 1.5.4 book - Part 62 of 185
The Ring programming language version 1.5.4 book - Part 62 of 185The Ring programming language version 1.5.4 book - Part 62 of 185
The Ring programming language version 1.5.4 book - Part 62 of 185
 
Nicety of java 8 multithreading for advanced, Max Voronoy
Nicety of java 8 multithreading for advanced, Max VoronoyNicety of java 8 multithreading for advanced, Max Voronoy
Nicety of java 8 multithreading for advanced, Max Voronoy
 

Destaque

2ª Etapa CSPC Viradouro SP
2ª Etapa  CSPC  Viradouro SP2ª Etapa  CSPC  Viradouro SP
2ª Etapa CSPC Viradouro SPsammoraes
 
Pmi sac november 20
Pmi sac november 20Pmi sac november 20
Pmi sac november 20Terry Bunio
 
Desarrollo de aplicaciones PHP con Azure
Desarrollo de aplicaciones PHP con AzureDesarrollo de aplicaciones PHP con Azure
Desarrollo de aplicaciones PHP con AzureAvanet
 
"MobileFirst and UX Design" - 120725
"MobileFirst and UX Design" - 120725"MobileFirst and UX Design" - 120725
"MobileFirst and UX Design" - 120725Satoru MURAKOSHI
 
Webアプリケーション開発での位置情報活用
Webアプリケーション開発での位置情報活用Webアプリケーション開発での位置情報活用
Webアプリケーション開発での位置情報活用Masakazu Muraoka
 
2013 12 02_osm 浜松セミナー
2013 12 02_osm 浜松セミナー2013 12 02_osm 浜松セミナー
2013 12 02_osm 浜松セミナーTom Hayakawa
 
2013 06-22osc nagoya-netmf
2013 06-22osc nagoya-netmf2013 06-22osc nagoya-netmf
2013 06-22osc nagoya-netmfAtomu Hidaka
 
変化する力〜これまでのキャリアを振り返って
変化する力〜これまでのキャリアを振り返って変化する力〜これまでのキャリアを振り返って
変化する力〜これまでのキャリアを振り返ってYoshihito Kuranuki
 
課題仮説検証完全マニュアルα版
課題仮説検証完全マニュアルα版課題仮説検証完全マニュアルα版
課題仮説検証完全マニュアルα版Lean Startup Japan LLC
 
Mundial Master mtb inscricao
Mundial Master mtb inscricaoMundial Master mtb inscricao
Mundial Master mtb inscricaosammoraes
 
Getting started raspberry pi osc hamamatsu
Getting started raspberry pi osc hamamatsuGetting started raspberry pi osc hamamatsu
Getting started raspberry pi osc hamamatsuMasafumi Ohta
 
[沖縄レキサスセミナー]小さな会社のゲームチェンジ
[沖縄レキサスセミナー]小さな会社のゲームチェンジ[沖縄レキサスセミナー]小さな会社のゲームチェンジ
[沖縄レキサスセミナー]小さな会社のゲームチェンジHiromichi Koga
 
2014 07 23 豊橋IT勉強会
2014 07 23 豊橋IT勉強会2014 07 23 豊橋IT勉強会
2014 07 23 豊橋IT勉強会Tom Hayakawa
 
Top connected friends photosブロック
Top connected friends photosブロックTop connected friends photosブロック
Top connected friends photosブロックtomohiko tanaka
 
HSE{Consult}: DevOps – новая методология разработки
HSE{Consult}: DevOps – новая методология разработкиHSE{Consult}: DevOps – новая методология разработки
HSE{Consult}: DevOps – новая методология разработкиBusiness incubator HSE
 

Destaque (20)

2ª Etapa CSPC Viradouro SP
2ª Etapa  CSPC  Viradouro SP2ª Etapa  CSPC  Viradouro SP
2ª Etapa CSPC Viradouro SP
 
Pmi sac november 20
Pmi sac november 20Pmi sac november 20
Pmi sac november 20
 
Desarrollo de aplicaciones PHP con Azure
Desarrollo de aplicaciones PHP con AzureDesarrollo de aplicaciones PHP con Azure
Desarrollo de aplicaciones PHP con Azure
 
62eboluzioa
62eboluzioa62eboluzioa
62eboluzioa
 
"MobileFirst and UX Design" - 120725
"MobileFirst and UX Design" - 120725"MobileFirst and UX Design" - 120725
"MobileFirst and UX Design" - 120725
 
Webアプリケーション開発での位置情報活用
Webアプリケーション開発での位置情報活用Webアプリケーション開発での位置情報活用
Webアプリケーション開発での位置情報活用
 
2013 12 02_osm 浜松セミナー
2013 12 02_osm 浜松セミナー2013 12 02_osm 浜松セミナー
2013 12 02_osm 浜松セミナー
 
2013 06-22osc nagoya-netmf
2013 06-22osc nagoya-netmf2013 06-22osc nagoya-netmf
2013 06-22osc nagoya-netmf
 
変化する力〜これまでのキャリアを振り返って
変化する力〜これまでのキャリアを振り返って変化する力〜これまでのキャリアを振り返って
変化する力〜これまでのキャリアを振り返って
 
課題仮説検証完全マニュアルα版
課題仮説検証完全マニュアルα版課題仮説検証完全マニュアルα版
課題仮説検証完全マニュアルα版
 
00 overview
00 overview00 overview
00 overview
 
Mundial Master mtb inscricao
Mundial Master mtb inscricaoMundial Master mtb inscricao
Mundial Master mtb inscricao
 
Getting started raspberry pi osc hamamatsu
Getting started raspberry pi osc hamamatsuGetting started raspberry pi osc hamamatsu
Getting started raspberry pi osc hamamatsu
 
[沖縄レキサスセミナー]小さな会社のゲームチェンジ
[沖縄レキサスセミナー]小さな会社のゲームチェンジ[沖縄レキサスセミナー]小さな会社のゲームチェンジ
[沖縄レキサスセミナー]小さな会社のゲームチェンジ
 
2014 07 23 豊橋IT勉強会
2014 07 23 豊橋IT勉強会2014 07 23 豊橋IT勉強会
2014 07 23 豊橋IT勉強会
 
Niver andrea
Niver andreaNiver andrea
Niver andrea
 
Top connected friends photosブロック
Top connected friends photosブロックTop connected friends photosブロック
Top connected friends photosブロック
 
Examen CapíTulos
Examen CapíTulosExamen CapíTulos
Examen CapíTulos
 
HSE{Consult}: DevOps – новая методология разработки
HSE{Consult}: DevOps – новая методология разработкиHSE{Consult}: DevOps – новая методология разработки
HSE{Consult}: DevOps – новая методология разработки
 
Osc2013 nagoya0622moodle
Osc2013 nagoya0622moodleOsc2013 nagoya0622moodle
Osc2013 nagoya0622moodle
 

Semelhante a Why Grails

Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010Chris Ramsdale
 
Groovy Ecosystem - JFokus 2011 - Guillaume Laforge
Groovy Ecosystem - JFokus 2011 - Guillaume LaforgeGroovy Ecosystem - JFokus 2011 - Guillaume Laforge
Groovy Ecosystem - JFokus 2011 - Guillaume LaforgeGuillaume Laforge
 
Google Developer Fest 2010
Google Developer Fest 2010Google Developer Fest 2010
Google Developer Fest 2010Chris Ramsdale
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyDavid Padbury
 
Porting legacy apps to Griffon
Porting legacy apps to GriffonPorting legacy apps to Griffon
Porting legacy apps to GriffonJames Williams
 
Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Jonathan Felch
 
Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Tugdual Grall
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing UpDavid Padbury
 
Geo script opengeo spring 2013
Geo script opengeo spring 2013Geo script opengeo spring 2013
Geo script opengeo spring 2013Ilya Rosenfeld
 
Improving Apache Spark Downscaling
 Improving Apache Spark Downscaling Improving Apache Spark Downscaling
Improving Apache Spark DownscalingDatabricks
 
Easy Cloud Native Transformation using HashiCorp Nomad
Easy Cloud Native Transformation using HashiCorp NomadEasy Cloud Native Transformation using HashiCorp Nomad
Easy Cloud Native Transformation using HashiCorp NomadBram Vogelaar
 
Integrating React.js Into a PHP Application
Integrating React.js Into a PHP ApplicationIntegrating React.js Into a PHP Application
Integrating React.js Into a PHP ApplicationAndrew Rota
 
Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineAndy McKay
 

Semelhante a Why Grails (20)

Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010Building Web Apps Sanely - EclipseCon 2010
Building Web Apps Sanely - EclipseCon 2010
 
Groovy Ecosystem - JFokus 2011 - Guillaume Laforge
Groovy Ecosystem - JFokus 2011 - Guillaume LaforgeGroovy Ecosystem - JFokus 2011 - Guillaume Laforge
Groovy Ecosystem - JFokus 2011 - Guillaume Laforge
 
Google Developer Fest 2010
Google Developer Fest 2010Google Developer Fest 2010
Google Developer Fest 2010
 
JBoss World 2010
JBoss World 2010JBoss World 2010
JBoss World 2010
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
 
Living with garbage
Living with garbageLiving with garbage
Living with garbage
 
Porting legacy apps to Griffon
Porting legacy apps to GriffonPorting legacy apps to Griffon
Porting legacy apps to Griffon
 
Node azure
Node azureNode azure
Node azure
 
huhu
huhuhuhu
huhu
 
React inter3
React inter3React inter3
React inter3
 
Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)Groovy On Trading Desk (2010)
Groovy On Trading Desk (2010)
 
Scripting Oracle Develop 2007
Scripting Oracle Develop 2007Scripting Oracle Develop 2007
Scripting Oracle Develop 2007
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
 
Geo script opengeo spring 2013
Geo script opengeo spring 2013Geo script opengeo spring 2013
Geo script opengeo spring 2013
 
Improving Apache Spark Downscaling
 Improving Apache Spark Downscaling Improving Apache Spark Downscaling
Improving Apache Spark Downscaling
 
Scripting GeoServer
Scripting GeoServerScripting GeoServer
Scripting GeoServer
 
Easy Cloud Native Transformation using HashiCorp Nomad
Easy Cloud Native Transformation using HashiCorp NomadEasy Cloud Native Transformation using HashiCorp Nomad
Easy Cloud Native Transformation using HashiCorp Nomad
 
Integrating React.js Into a PHP Application
Integrating React.js Into a PHP ApplicationIntegrating React.js Into a PHP Application
Integrating React.js Into a PHP Application
 
The MEAN stack
The MEAN stack The MEAN stack
The MEAN stack
 
Cross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App EngineCross Domain Web
Mashups with JQuery and Google App Engine
Cross Domain Web
Mashups with JQuery and Google App Engine
 

Mais de Yiguang Hu

Data analysis scala_spark
Data analysis scala_sparkData analysis scala_spark
Data analysis scala_sparkYiguang Hu
 
Java8 and Functional Programming
Java8 and Functional ProgrammingJava8 and Functional Programming
Java8 and Functional ProgrammingYiguang Hu
 
Introduction to Vert.x
Introduction to Vert.xIntroduction to Vert.x
Introduction to Vert.xYiguang Hu
 
Cross platform Mobile development on Titanium
Cross platform Mobile development on TitaniumCross platform Mobile development on Titanium
Cross platform Mobile development on TitaniumYiguang Hu
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web ToolkitsYiguang Hu
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web ToolkitsYiguang Hu
 

Mais de Yiguang Hu (10)

Data analysis scala_spark
Data analysis scala_sparkData analysis scala_spark
Data analysis scala_spark
 
Java8 and Functional Programming
Java8 and Functional ProgrammingJava8 and Functional Programming
Java8 and Functional Programming
 
Introduction to Vert.x
Introduction to Vert.xIntroduction to Vert.x
Introduction to Vert.x
 
Cross platform Mobile development on Titanium
Cross platform Mobile development on TitaniumCross platform Mobile development on Titanium
Cross platform Mobile development on Titanium
 
Phone Gap
Phone GapPhone Gap
Phone Gap
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web Toolkits
 
Clojure
ClojureClojure
Clojure
 
Why Grails?
Why Grails?Why Grails?
Why Grails?
 
Gsword
GswordGsword
Gsword
 
Google Web Toolkits
Google Web ToolkitsGoogle Web Toolkits
Google Web Toolkits
 

Último

The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
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
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
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
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...panagenda
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
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
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 

Último (20)

The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
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
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
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
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
Why device, WIFI, and ISP insights are crucial to supporting remote Microsoft...
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
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
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 

Why Grails

  • 1. Why  Grails?   Yiguang  Hu  
  • 2. What  is  Grails?   •  Grails  is  a  web  framework  based  on   –  JAVA,  GROOVY,  Spring,  GORM   •  Scaffolding!   •  Plugin  everything!!!   –  GWT,  DWR,  YUI,  ACEGI,  Google  AppEngine,  Google   Wave,  COMET,  JQuery,  Clojure,  Scala,  JSF,  Struts…   •  Support  all  modern  browsers  automaRcally   •  Render  object  to  JSON,  XML  free!   •  MVC+IOC(services)+plugin  
  • 3. Why  Grails?   •  Rapid   –  Have  your  next  Web  2.0  project  done  in  weeks  instead  of   months.  Grails  delivers  a  new  age  of  Java  web  applicaRon   producRvity.   •  Dynamic   –  Get  instant  feedback,  see  instant  results.  Grails  is  the   premier  dynamic  language  web  framework  for  the  JVM.   •  Robust   –  Powered  by  Spring,  Grails  out  performs  the  compeRRon.   Dynamic,  agile  web  development  without  compromises.   •  Proven  Technologies:  JAVA(Groovy),  Spring,  GORM  
  • 4. What  is  Groovy?   •  Groovy  =   –  JAVA+Dynamic  Typing+Closure+   DSL,  GPars,Griffon….   •  Runs  on  JVM   • 0  Learning  curve  for  Java  programmer  
  • 5. Success  Stories   •  The  Sites  I  personally  involved:   –  Worthpoint.com  (80  million  records)   –  Gsword:  h_p://www.ccimweb.org/gsword   •  Web  2.0.  Highly  interacRve.   •  Done  in  two  days!   –  Others  
  • 6. Demo   •  Install  java,  groovy,  grails   •  grails  create-­‐app  interop   –  Goto  dir  interop  and  see  the  dires/files  created   •  Run  it!   •  Add  domain   •  Generate  controller/views  and  run   –  SorRng,  paginaRon  are  there  already!   •  Add  a  service  and  use  in  controller   •  Run  it!  
  • 7. Demo…   •  SOA   –  Render  objects  as  JSON,  XML  etc   –  Import  grails.converters.*;   •  Parallel  compuRng  in  Services  using  GPars   •  Using  other  languages  like  Clojure  in  grails   •  …  
  • 8. Performance  Concern?   •  User  Java  in  high  demanding  place   •  Gpars  (Actors,  map  reducer…)   •  Use  clojure  in  services   •  User  Scala  in  services   •  Yes.  It  is  AGILE!  
  • 9. Clojure  Demo   •  grails  install-­‐plugin  clojure   •  New  dir  src/clj  is  created   •  Add  file  Addnumber.clj  in  src/clj   (ns  grails)   (def  twenty  20)   (defn  add_numbers  [a  b]          (+  a  b))  
  • 10. Call  Clojure  from  Service   class  ClojService  {          boolean  transacRonal  =  false          def  addNumbers(x,  y)  {          clj.add_numbers(x,  y)          }        def  addTwenty(x)  {        clj.add_numbers(x,  clj.twenty)        }   }  
  • 11. Call  Service  in  Controller   import  grails.converters.XML;   class  PlayController  {          def  index  =  {  }      def  clojService   def  cljaddnumber={                render  clojService.addNumbers(Integer.parseInt(params.a?:"5"),   Integer.parseInt(params.b?:"4"))      }      def  cljadd20={          render  clojService.addTwenty(Integer.parseInt(params.a?:"10"))      }   }  
  • 12. Gpars  Map  Reducer  Demo   //@Grab(group='org.codehaus.gpars',  module='gpars',  version='0.9')   import  staRc  groovyx.gpars.Parallelizer.*   class  ConcurrentService  {          boolean  transacRonal  =  true          def  sqr()  {              def  myNumbers              doParallel{            myNumbers  =  (1..1000).parallel.filter{it  %  2  ==  0}.map{Math.sqrt   it}.collecRon              }              myNumbers          }  
  • 13. Gpars  Map  Reducer  Demo   def  search(String  key,keys){            key+":"+  keys.replaceAll(key,key.toUpperCase())        /turns  key  to  upper  case      }      def  webs=["a  b  c  d  e  f  g  h  j  k  i  o  as  da  o  sa  ds  h  vcx  aw  s  dsf  gdsg    ds  ,  bbx   fdwvcx  786  ",  "b  sd  sd  sd  dsfgh  fds    ewr  56y    k  o  aw    n  q    12    g    n  1          uy  t  r",                      "sad  assa  sa  sa  sa  sa  456t465367  45  45  23  23  12      453  43  5  3  234  523  ",                      "8sdf  ds  5ue    we    123    42  hg    h  k      s  x  d  f    t  r  g  h  j    y  k  v    b  n    m  l  qw  ew  c"]      def  reducer(String  key)  {                def  rst          doParallel  {   rst  =  webs.parallel.map  {search(key,it)}.collecRon          }          rst      }}