grails and the world of tomorrow
DESCRIPTION
A look at the changing development landscape and how we may have to rearchitect our Grails applications. Also looks at existing, new, or potential Grails features that can help navigate this new world order.TRANSCRIPT
![Page 1: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/1.jpg)
Grails and the World of Tomorrow
Peter LedbrookVMware
t: @pledbrookg: +PeterLedbrooke: [email protected]
![Page 2: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/2.jpg)
2
Cloud
NoSQL
CloudCloud
HTML5.js
SocialConcurrency
![Page 3: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/3.jpg)
HTML5.js
3
Web sites Applications
Server-side HTMLLow interactivityNo offline
Client-side HTMLHigh interactivityOffline
Wikipedia Twitter
![Page 4: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/4.jpg)
HTML5.js
4
Web sites Applications
Server-side HTMLLow interactivityNo offline
Client-side HTMLHigh interactivityOffline
We’re going this way!
REST + JSON
Backbone.js + Moustache
Is this the end for GSP?
![Page 5: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/5.jpg)
NoSQL
5
Data the way you want it!
![Page 6: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/6.jpg)
NoSQL
6
“Everyone has interesting data”Some guy
![Page 7: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/7.jpg)
Social
7
![Page 8: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/8.jpg)
Cloud
8
Ephemeral filesystems
Easy instance creation
Service-oriented architecture
![Page 9: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/9.jpg)
Concurrency
9
Responsiveness
Lots of concurrent users
What about all those cores?
Node.js/Vert.x & the Reactor pattern
![Page 10: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/10.jpg)
10
![Page 11: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/11.jpg)
Where do we go from here?
• Has CRUD still got legs?
• Does even MVC still make sense?
• Or do we need to fundamentally change the way we write apps?
11
What can Grails do for me?
![Page 12: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/12.jpg)
A typical Grails app
12
Controller View
HTTP
Service
GORM/Hibernate
Database
![Page 13: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/13.jpg)
A typical Grails app
13
Controller View
HTTP
Service
GORM/Hibernate
Database
OSIVI
Domainobjects
Relational/object impedance mismatch
Domain class binding
Sticky sessions
![Page 14: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/14.jpg)
Fit for purpose?
• CRUD has its place– Admin UIs– Quick UIs for complex domain models
• CRUD = dynamic scaffolding• But beyond CRUD...• ... what about MVC + ORM?
– Rich UIs + REST don’t need views– Do UI forms match domain classes?– Do views require the same information as updates?– How do we track changes to data?– Where should validation occur?
14
![Page 15: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/15.jpg)
A typical Grails app
15
Controller View
HTTP
Service
GORM/Hibernate
Database
Command objects?
Bind COs todomains?
importFrom(Domain)
Disable OSIVI?
Filtering and transforming
data
@Cacheable, not 2nd-level cache?
Don’t let HTTP session and Hibernate session
mix?
![Page 16: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/16.jpg)
Introducing CQRS
16
Updates
Views
Concurrency via event bus
Store changes
Separate data stores for queries
![Page 17: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/17.jpg)
Is it too complex?
• PaaS makes it easy to use multiple data stores• Event bus allows for decoupling
– Easier to understand than Hibernate events– Search “mirroring” would work!– Easily extended to external message broker– Synchronise multiple instances of same app on PaaS
• Querying and updating already separated– PluginService & PluginUpdateService in grails.org
• Groovy good for data transformations
17
Conventions and framework support to make it easier!
![Page 18: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/18.jpg)
How can Grails help - Rich UIs?
18
URL mappings for REST
JSON & XML converters
Resources (for JS & CSS)
Plugins for different UI libraries
![Page 19: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/19.jpg)
How can Grails help - NoSQL?
19
GORM plugins
JSON handling
Schemaless + dynamic lang = good!
![Page 20: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/20.jpg)
How can Grails help - Social?
20
Spring Social plugin, etc.
Authentication via plugins
![Page 21: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/21.jpg)
How can Grails help - Cloud?
21
Simplified deployment with plugins
Plugins for PaaS services
Runtime config
![Page 22: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/22.jpg)
How can Grails help?
22
![Page 23: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/23.jpg)
How can Grails help?
23
Plugins
![Page 24: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/24.jpg)
How can Grails help?
24
Plugins
![Page 25: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/25.jpg)
How can Grails help?
25
Plugins
![Page 26: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/26.jpg)
How can Grails help?
26
Plugins
![Page 27: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/27.jpg)
Plugin platform
27
Events
Injection
Config
UI
Security
Conventions
![Page 28: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/28.jpg)
Plugin platform
28
Events Security
![Page 29: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/29.jpg)
Plugin platform
29
Events Security
• Event bus• Can integrate with AMQP• GORM events• App lifecycle events• Custom app events
• API + SPI• Service• Tags
https://github.com/Grailsrocks/grails-platform-core
![Page 30: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/30.jpg)
Event bus
30
Event Bus
Plugins ApplicationPluginsPlugins
Spring Integration AMQP
Save entity IndexUpdate
read DBsCall REST
service
![Page 31: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/31.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!
• Grails already has many of the features we need• Plugins can add those• Plugin platform provides more powerful integration
– Event bus will enable more interesting architectures
31
![Page 32: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/32.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/
32
![Page 33: Grails and the World of Tomorrow](https://reader033.vdocument.in/reader033/viewer/2022051515/554f8d8bb4c905435d8b4eaf/html5/thumbnails/33.jpg)
Q & A