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

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Último (20)

AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

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      }}