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
Grails and the World of Tomorrow
Peter LedbrookVMware
t: @pledbrookg: +PeterLedbrooke: [email protected]
2
Cloud
NoSQL
CloudCloud
HTML5.js
SocialConcurrency
HTML5.js
3
Web sites Applications
Server-side HTMLLow interactivityNo offline
Client-side HTMLHigh interactivityOffline
Wikipedia Twitter
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?
NoSQL
5
Data the way you want it!
NoSQL
6
“Everyone has interesting data”Some guy
Social
7
Cloud
8
Ephemeral filesystems
Easy instance creation
Service-oriented architecture
Concurrency
9
Responsiveness
Lots of concurrent users
What about all those cores?
Node.js/Vert.x & the Reactor pattern
10
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?
A typical Grails app
12
Controller View
HTTP
Service
GORM/Hibernate
Database
A typical Grails app
13
Controller View
HTTP
Service
GORM/Hibernate
Database
OSIVI
Domainobjects
Relational/object impedance mismatch
Domain class binding
Sticky sessions
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
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?
Introducing CQRS
16
Updates
Views
Concurrency via event bus
Store changes
Separate data stores for queries
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!
How can Grails help - Rich UIs?
18
URL mappings for REST
JSON & XML converters
Resources (for JS & CSS)
Plugins for different UI libraries
How can Grails help - NoSQL?
19
GORM plugins
JSON handling
Schemaless + dynamic lang = good!
How can Grails help - Social?
20
Spring Social plugin, etc.
Authentication via plugins
How can Grails help - Cloud?
21
Simplified deployment with plugins
Plugins for PaaS services
Runtime config
How can Grails help?
22
How can Grails help?
23
Plugins
How can Grails help?
24
Plugins
How can Grails help?
25
Plugins
How can Grails help?
26
Plugins
Plugin platform
27
Events
Injection
Config
UI
Security
Conventions
Plugin platform
28
Events Security
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
Event bus
30
Event Bus
Plugins ApplicationPluginsPlugins
Spring Integration AMQP
Save entity IndexUpdate
read DBsCall REST
service
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
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
Q & A