The document discusses using Grails for developing an enterprise telecom application. It describes the application and deployment environment, how Grails improved development productivity, and key plugins and techniques used. Grails enabled faster development through GORM and scaffolding. AST transformations and custom components further improved code readability and maintainability. While there were frustrations with Grails, overall the developers found Groovy and Grails empowering and were enthusiastic about the technology.
2. About myself
▸ Ivo Houbrechts
▸ Belgium
▸ Grails user and plugin developer
▸ ivo.houbrechts@ixor.be
2
3. About Ixor
▸ Since 2002
▸ 40 experienced ICT professionals
▸ Software development for the JVM
▸ Consultancy and product development
▸ Loyal customers in Finance, Telecom and
Government
3
4. Agenda
▸ Grails as part of Java EE
▸ Enterprise telco app
▸ Development environment
▸ Development productivity
▸ Plugins
▸ Conclusions
4
5. Agenda
▸ Enterprise telco app
▸ Development environment
▸ Development productivity
▸ Plugins
▸ Conclusions
4
10. To Grails or not to Grails
▸ Spring MVC + Freemarker
– no components
– (almost) no IDE support
▸ project behind schedule
➭ speed up with Grails
9
11. To Grails or not to Grails
▸ Spring MVC + Freemarker
– no components
– (almost) no IDE support
?
▸ project behind schedule
➭ speed up with Grails
9
12. Build
▸ Multi module Maven project
–Command line Grails
• Mix Ivy and maven dependency resolution
• CI agents need both Maven and Grails
• Improved maven support in Grails 2.1
–9 modules
• JAXB / WS
• AST
• Grails inline plugins
• Grails war, ear, config resources
10
13. Development team
▸ 2 scrum teams, 14 developers
▸ Groovy / Grails experience is rare
▸ Learning curve
– 2 weeks self study
– dynamic language
– Intellij IDEA
▸ Vast majority enthusiastic
11
28. UI components
▸ Html in GSPs becomes problematic
– huge GSPs
– virtual impossible to change look and feel
– inconsistent development
➭ custom tags / components with documented
API
21
32. UI components
▸ Grails tag
– documented component API, code completion
– ideal for logic
– not suited for markup:
def box = { attrs, body ->
out << “<div class=”box $clazz>”<div class=”boxHeader”>”
out << attrs.header << “</div><div class=”boxBody”>”
out << body()
out << “<div>”
}
24
33. UI components
▸ tmpl namespace
– markup in GSP
– simple to use
– no documented API, no code completion, etc.
▸ render template from tag
– markup in GSP
– documented API, code completion, etc.
– maintenance hell
25
34. UI components
▸ GSP taglib plugin
– simple to use
– documented API, code completion, etc.
– tags in taglib directory
– generated xxxTagLib.groovy
26
35. UI components
▸ GSP taglib plugin
– simple to use
– documented API, code completion, etc.
– tags in taglib directory
– generated xxxTagLib.groovy
26
41. Rich domain DI
▸ DI for non-Grails domain classes
– @Inject, @Resource
– auto wiring at object initialization and de-serialization
– move logic from controllers to domain classes
▸ see http://livesnippets.cloudfoundry.com
@RichDomain
class Customer {
@Inject
transient CustomerWebService customerWebService
...
}
30
46. Developer experience
▸ Frustrations
– Build
– debugger
– Runtime vs compile time errors
– Grails upgrades
▸ Satisfaction
– Groovy power
– Convention over configuration
– Fun
▸ Generally enthusiastic
35
47. Developer experience
▸ Frustrations
– Build
– debugger
– Runtime vs compile time errors
– Grails upgrades
▸ Satisfaction
– Groovy power
– Convention over configuration
– Fun
▸ Generally enthusiastic
35
48. Development cost
▸ Fast kickoff with Grails
– GORM
– Scaffolding
▸ Short term development cost
– Determined by domain complexity
– Technology is minor factor
▸ Long term benefits
– Code size
– Code readability
36
49. Development cost
▸ Fast kickoff with Grails
– GORM
– Scaffolding
▸ Short term development cost
– Determined by domain complexity
– Technology is minor factor
▸ Long term benefits
– Code size
– Code readability
36
50. Development cost
▸ Fast kickoff with Grails
– GORM
– Scaffolding
▸ Short term development cost
– Determined by domain complexity
– Technology is minor factor
▸ Long term benefits
– Code size
– Code readability
36
51. Development cost
▸ Fast kickoff with Grails
– GORM
– Scaffolding
▸ Short term development cost
– Determined by domain complexity
– Technology is minor factor
▸ Long term benefits
– Code size
– Code readability
36