![Page 1: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/1.jpg)
Peter Ledbrook
Grails Update
1Monday, 30 May 2011
![Page 2: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/2.jpg)
Past year
• Grails 1.3 line– Plugins in dependency DSL
• More and more plugins– Spring Security Core et al.– RabbitMQ– Gemfire– Resources, etc.
• noSQL– Redis, MongoDB, Riak, etc.
2
2Monday, 30 May 2011
![Page 3: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/3.jpg)
New users
3
3Monday, 30 May 2011
![Page 4: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/4.jpg)
Grails 1.4
• Groovy 1.8
• Spring 3.1
• Hibernate 3.6
• Tomcat 7
• Prototype => jQuery
4
4Monday, 30 May 2011
![Page 5: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/5.jpg)
Grails 1.4
• Data storage
• Better testing
• User experience
• A better look
• A truly collaborative effort
5
5Monday, 30 May 2011
![Page 6: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/6.jpg)
Grails 1.4
• Data storage
• Better testing
• User experience
• A better look
• A truly collaborative effort
6
6Monday, 30 May 2011
![Page 7: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/7.jpg)
GORM API
• Plugins should not assume Hibernate!
7
7Monday, 30 May 2011
![Page 8: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/8.jpg)
?
SQL database migration
8
Hibernate ‘update’+
Production data=
8Monday, 30 May 2011
![Page 9: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/9.jpg)
SQL database migration
9
Liquibase
Autobase
+Database MigrationPlugin
9Monday, 30 May 2011
![Page 10: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/10.jpg)
SQL database migration
10
Pre-production, Hibernate ‘update’ or ‘create-drop’
dbm-generate-changelogdbm-changelog-sync
Change domain model
dbm-gorm-diffdbm-update
10Monday, 30 May 2011
![Page 11: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/11.jpg)
SQL reverse engineering
11
install-plugin db-reverse-engineer
class Person { String name Integer age ...}
11Monday, 30 May 2011
![Page 12: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/12.jpg)
Other database stuff
• Abstract base domain classes– These now result in a table
• findOrCreateWhere()• findOrSaveWhere()
12
def user = User.findByLogin('admin')if (!user) { user = new User(login: 'admin') user.save(failOnError: true)}
def user = User.findOrSaveWhere(login: 'admin')
12Monday, 30 May 2011
![Page 13: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/13.jpg)
Grails 1.4
• Data storage
• Better testing
• User experience
• A better look
• A truly collaborative effort
13
13Monday, 30 May 2011
![Page 14: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/14.jpg)
Unit testing pre-1.4
• mockDomainClass() had only partial GORM support– always lagged changes in GORM
• Inheritance-based– hierarchy duplicated for Spock– difficult to extend
• Weak support for web-related testing– controllers– tag libraries
14
14Monday, 30 May 2011
![Page 15: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/15.jpg)
The mixin approach
15
class MyControllerUnitTests extends ControllerUnitTestCase { void setUp() { mockDomain(Person, [ new Person(...), new Person(...) ]) }
void testIndex() { def model = this.controller.index() ... }}
15Monday, 30 May 2011
![Page 16: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/16.jpg)
The mixin approach
16
class MyControllerUnitTests { void setUp() { mockDomain(Person, [ new Person(...), new Person(...) ]) }
void testIndex() { def model = this.controller.index() ... }}
16Monday, 30 May 2011
![Page 17: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/17.jpg)
The mixin approach
17
@TestFor(MyController)@Mock(Person)class MyControllerUnitTests { void setUp() { mockDomain(Person, [ new Person(...), new Person(...) ]) }
void testIndex() { def model = this.controller.index() ... }}
17Monday, 30 May 2011
![Page 18: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/18.jpg)
The mixin approach
18
@TestFor(MyController)@Mock(Person)class MyControllerUnitTests { void setUp() { new Person(...).save() new Person(...).save() }
void testIndex() { def model = this.controller.index() ... }}
18Monday, 30 May 2011
![Page 19: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/19.jpg)
The mixin approach (optional)
19
@TestFor(MyController)@Mock(Person)class MyControllerUnitTests { @Before void before() { new Person(...).save() new Person(...).save() }
@Test void indexAction() { def model = this.controller.index() ... }}
19Monday, 30 May 2011
![Page 20: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/20.jpg)
Support for testing...
• Tag libraries• Command objects• XML & JSON responses• File upload• View and template rendering• Filters• URL mappings• Criteria queries• and more!
20
20Monday, 30 May 2011
![Page 21: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/21.jpg)
Grails 1.4
• Data storage
• Better testing
• User experience
• A better look
• A truly collaborative effort
21
21Monday, 30 May 2011
![Page 22: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/22.jpg)
New automatic reloading
• Reloading in run-app works with– Typed service references– Domain classes– src/groovy, src/java
• Any command with -agent• Interactive mode and integration tests?
22
22Monday, 30 May 2011
![Page 23: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/23.jpg)
Plugin portal
23
How many people use each plugin?We don’t know
+ Plugin usage tracking+ Grails usage tracking+ More info about plugins
LicenceDevelopersIssue trackerSCMDependencies (JAR & plugin)
23Monday, 30 May 2011
![Page 24: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/24.jpg)
Other stuff
• Snapshot handling fixed– No need to clear Ivy cache when new snapshot available
• Interactive mode– Eliminate Permgen errors?
• H2 console– Out of the box interrogation of database
• Binary plugins– Plugins as JAR dependencies!
• AST transforms– Use domain classes from Java!– Real ‘errors’ and ‘log’ properties!
• Public methods on controllers == actions
24
24Monday, 30 May 2011
![Page 25: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/25.jpg)
Grails 1.4
• Data storage
• Better testing
• User experience
• A better look
• A truly collaborative effort
25
25Monday, 30 May 2011
![Page 26: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/26.jpg)
26
26Monday, 30 May 2011
![Page 27: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/27.jpg)
Grails 1.4
• Data storage
• Better testing
• User experience
• A better look
• A truly collaborative effort
27
27Monday, 30 May 2011
![Page 28: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/28.jpg)
Contributors
28
Marc Palmer
Resources
28Monday, 30 May 2011
![Page 29: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/29.jpg)
Contributors
29
Rob Fletcher
Scaffolding &jQuery
29Monday, 30 May 2011
![Page 30: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/30.jpg)
Contributors
30
Stéphane Maldini
AST Magic
30Monday, 30 May 2011
![Page 31: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/31.jpg)
Contributors
31
Luke Daley
Snapshot deps & testing
31Monday, 30 May 2011
![Page 32: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/32.jpg)
Contributors
32
Jonathan Pearlin
Maven
32Monday, 30 May 2011
![Page 33: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/33.jpg)
Contributors
33
Kim Betti
JUnit Test Reports
33Monday, 30 May 2011
![Page 34: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/34.jpg)
Contributors
34
34Monday, 30 May 2011
![Page 35: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/35.jpg)
Other contributions
• 60+ pull requests on grails-core• 35+ pull requests on grails-docs• More and more plugins• GitHub for the win!
– grails-core– grails-docs– grails-website– grails-maven– and many, many plugins
35
35Monday, 30 May 2011
![Page 36: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/36.jpg)
Grails in the cloud
36
?
36Monday, 30 May 2011
![Page 37: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/37.jpg)
For the future
• A continued focus on
– Reliability
– User experience
– Modularity
– More cloud
37
37Monday, 30 May 2011
![Page 38: GR8Conf 2011: Grails 1.4 Update by Peter Ledbrook](https://reader036.vdocument.in/reader036/viewer/2022081400/55587640d8b42a8d018b52ef/html5/thumbnails/38.jpg)
38
Thank you!
Questions?
38Monday, 30 May 2011