grails & the world of tomorrow
DESCRIPTION
This is the Grails WOT presentation delivered at SpringOne 2GX. It looks at the current state of the development landscape, how Grails can help you work with all the new technologies, and what the future might hold.TRANSCRIPT
![Page 1: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/1.jpg)
Grails & the World of Tomorrow
Peter Ledbrook, Developer [email protected] / @pledbrook
© 2012 SpringOne 2GX. All rights reserved. Do not distribute without permission.
1
![Page 2: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/2.jpg)
Cloud
NoSQL
CloudCloud
HTML5.js
Social
2
![Page 3: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/3.jpg)
HTML5.js
Web sites Applications
Server-side HTMLLow interactivityNo offline
Client-side HTMLHigh interactivityOffline
Wikipedia
3
![Page 4: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/4.jpg)
HTML5.js
Web sites Applications
Server-side HTMLLow interactivityNo offline
Client-side HTMLHigh interactivityOffline
4
![Page 5: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/5.jpg)
HTML5.js
Web sites Applications
Server-side HTMLLow interactivityNo offline
Client-side HTMLHigh interactivityOffline
GMail
5
![Page 6: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/6.jpg)
HTML5.js
Web sites Applications
Server-side HTMLLow interactivityNo offline
Client-side HTMLHigh interactivityOffline
We’re going this way!
Example:
REST + JSON
Backbone.js + Moustache
6
![Page 7: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/7.jpg)
Google I/O 2012
Android activations to date
400 million
Apple WWDC 2012
iOS devices sold to date
365 million
7
![Page 8: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/8.jpg)
Is this the end for server-side templates?
8
![Page 9: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/9.jpg)
NoSQL / Big Data
Data the way you want it!
9
![Page 10: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/10.jpg)
NoSQL / Big Data
Everyone has interesting data
10
![Page 11: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/11.jpg)
11
![Page 12: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/12.jpg)
Cloud
Scaling Reduced capital costs
Easier administration
12
![Page 13: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/13.jpg)
Cloud
Ephemeral filesystems
Session management
No Multicast
13
![Page 14: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/14.jpg)
14
![Page 15: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/15.jpg)
A typical Grails app
Controller View
HTTP
Service
GORM/Hibernate
Database
15
![Page 16: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/16.jpg)
16
![Page 17: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/17.jpg)
What do these cars have in common?
17
![Page 18: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/18.jpg)
Same platform, different components
18
![Page 19: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/19.jpg)
Core Grails == Chassis
Plugins == Components
19
![Page 20: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/20.jpg)
How can Grails help - Rich UIs?
URL mappings for REST
JSON & XML converters
Resources (for JS & CSS)
zipping, caching, compression
20
![Page 21: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/21.jpg)
Static resource handling
App
Kickstart Bootstrap Plugin Shiro UI Plugin
Twitter Bootstrap Plugin
21
![Page 22: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/22.jpg)
Scaffolding libraries
> grails install-plugin jquery-mobile-scaffolding> grails install-mobile-templates> grails create-domain-class org.example.Todo
<edit Book.groovy>
> grails generate-all org.example.Todo> grails run-app
22
![Page 23: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/23.jpg)
How can Grails help - Social?
oauth { providers { twitter { api = TwitterApi key = 'my-key' secret = 'my-secret' successUri = '/' failureUri = '/' } }}
Simplified OAuth via OAuth plugin:
23
![Page 24: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/24.jpg)
How can Grails help - Social?
<oauth:connect provider="twitter"> Connect to Twitter</oauth:connect>
class MyService { def oauthService
def myMethod() { def twitterUsers = oauthService.getTwitterResource( twitterAccessToken, "http://api.yourprovider.com/users/list") ... }}
24
![Page 25: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/25.jpg)
How can Grails help - NoSQL?
Accessible NoSQL via GORM
Domain Model
GORM
25
![Page 26: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/26.jpg)
How can Grails help - Cloud?
Cache plugin
RedisEhcache
For HTTP sessions, Database Session plugin
Solve the caching problem with the Cache plugin
Database Session plugin
CookieMongoDB
26
![Page 27: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/27.jpg)
27
![Page 28: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/28.jpg)
PaaS deployment
AppRedis Plugin Rabbitmq Plugin
> grails cf-push
28
![Page 29: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/29.jpg)
What about horizontal scalability?
29
![Page 30: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/30.jpg)
Introducing CQRS
Updates
Views
Concurrency via event bus
Store changes
Separate data stores for queries
30
![Page 31: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/31.jpg)
Event bus (Platform Core plugin)
Event Bus
Plugins ApplicationPluginsPlugins
Save entity IndexUpdate
read DBsCall REST
service
31
![Page 32: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/32.jpg)
Event bus (Events SI plugin)
Event Bus (SI)
Plugins ApplicationPluginsPlugins
Save entity IndexUpdate
read DBsCall REST
service
AMQP
32
![Page 33: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/33.jpg)
Event bus (Events Push plugin)
Event Bus (SI)
Plugins ApplicationPluginsPlugins
Event Bridge
Browser
33
![Page 34: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/34.jpg)
grailsTodos sample
34
![Page 35: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/35.jpg)
grailsTodos sample
35
![Page 36: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/36.jpg)
grailsTodos sample
36
![Page 37: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/37.jpg)
grailsTodos sample
37
![Page 38: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/38.jpg)
grailsTodos sample
http://grailstodos.cloudfoundry.com/todos/
Try it:
See the code:
http://github.com/smaldini/grailsTodos
38
![Page 39: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/39.jpg)
Enabling plugin authors
39
![Page 40: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/40.jpg)
More Platform Core
Security API
Who is the current user?
Does the user have a particular role?
Is user permitted to do something?
40
![Page 41: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/41.jpg)
More Platform Core
Navigation API
Menu
Application Plugin
Action
Action
41
![Page 42: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/42.jpg)
More Platform Core
Config API
Declare config options
Automatic namespacing
Default values & automatic merging
42
![Page 43: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/43.jpg)
More Platform Core
Convention API
static searchable = { ... } @Taggable
Convention overrides!
e.g.
43
![Page 44: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/44.jpg)
Platform UI
Themes
+
UI tags
e.g. App Info plugin + Bootstrap Kickstart
44
![Page 45: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/45.jpg)
Project archetypes?
45
![Page 46: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/46.jpg)
SQL database
CRUD
jQuery
Multi page
46
![Page 47: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/47.jpg)
SQL for write
REST endpoints
AngularJS
Redis for read
47
![Page 48: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/48.jpg)
Events
Web Sockets (with emulation)
Spring Integration
48
![Page 49: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/49.jpg)
Summary
• The way applications are architected will change– Websites will still be built (GSP not gone yet)– Not everyone will need the same architecture– Project archetypes and scaffolding!
• No single framework has everything you need• Pick and choose the appropriate components for your
49
![Page 50: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/50.jpg)
More info
• w: http://grails.org/• f: http://grails.org/Mailing+Lists
• e: [email protected]• t: pledbrook• b: http://blog.springsource.com/author/peter-ledbrook/
50
![Page 51: Grails & the World of Tomorrow](https://reader036.vdocuments.us/reader036/viewer/2022062405/554f5bc2b4c905524c8b553f/html5/thumbnails/51.jpg)
Q & A
51