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.
3. HTML5.js
Web sites Applications
Server-side HTML Client-side HTML
Low interactivity High interactivity
No offline Offline
Wikipedia Twitter
3
4. HTML5.js
We’re going this way!
Web sites Applications
Server-side HTML Client-side HTML
Low interactivity High interactivity
No offline Offline
REST + JSON
Backbone.js + Moustache
Is this the end for GSP?
4
11. 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?
What can Grails do
for me?
11
12. A typical Grails app
HTTP
Controller View
Service
GORM/Hibernate
Database
12
13. A typical Grails app
HTTP Sticky sessions
OSIVI
Controller View
Domain class
binding
Domain
Service objects
GORM/Hibernate
Relational/object
Database impedance
mismatch
13
14. 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
15. A typical Grails app
HTTP
Disable OSIVI?
Controller View
Command objects?
Don’t let HTTP session
and Hibernate session
mix?
Bind COs to Service @Cacheable, not
domains? 2nd-level cache?
importFrom(Domain)
GORM/Hibernate
Filtering and
transforming
data
Database
15
16. Introducing CQRS
Updates
Store
changes
Concurrency
via event bus
Views
Separate data
stores for queries
16
17. 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
Conventions and framework
support to make it easier!
17
18. How can Grails help - Rich UIs?
URL mappings for REST
JSON & XML converters
Resources (for JS & CSS)
Plugins for different UI libraries
18
19. How can Grails help - NoSQL?
GORM plugins
JSON handling
Schemaless + dynamic lang = good!
19
20. How can Grails help - Social?
Spring Social plugin, etc.
Authentication via plugins
20
21. How can Grails help - Cloud?
Simplified deployment with plugins
Plugins for PaaS services
Runtime config
21
29. Plugin platform
Events Security
• Event bus • API + SPI
• Can integrate with AMQP • Service
• GORM events • Tags
• App lifecycle events
• Custom app events
https://github.com/Grailsrocks/grails-platform-core
29
30. Event bus
Update Call REST
Save entity Index read DBs service
Spring Integration Event Bus AMQP
Plugins
Plugins
Plugins Application
30
31. 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
32. More info
• w: http://grails.org/
• f: http://grails.org/Mailing+Lists
• e: pledbrook@vmware.com
• t: pledbrook
• b: http://blog.springsource.com/author/peter-ledbrook/
32