2. 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
Monday, 30 May 2011 2
10. SQL database migration
Pre-production, Hibernate ‘update’ or ‘create-drop’
dbm-generate-changelog
dbm-changelog-sync
Change domain model
dbm-gorm-diff
dbm-update
10
Monday, 30 May 2011 10
11. SQL reverse engineering
install-plugin db-reverse-engineer
class Person {
String name
Integer age
...
}
11
Monday, 30 May 2011 11
12. Other database stuff
• Abstract base domain classes
– These now result in a table
• findOrCreateWhere()
• findOrSaveWhere()
def user = User.findByLogin('admin')
if (!user) {
def user = User.findOrSaveWhere(login: 'admin')
user = new User(login: 'admin')
user.save(failOnError: true)
}
12
Monday, 30 May 2011 12
13. Grails 1.4
• Data storage
• Better testing
• User experience
• A better look
• A truly collaborative effort
13
Monday, 30 May 2011 13
14. 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
Monday, 30 May 2011 14
15. The mixin approach
class MyControllerUnitTests extends ControllerUnitTestCase {
void setUp() {
mockDomain(Person, [
new Person(...),
new Person(...) ])
}
void testIndex() {
def model = this.controller.index()
...
}
}
15
Monday, 30 May 2011 15
16. The mixin approach
class MyControllerUnitTests {
void setUp() {
mockDomain(Person, [
new Person(...),
new Person(...) ])
}
void testIndex() {
def model = this.controller.index()
...
}
}
16
Monday, 30 May 2011 16
17. The mixin approach
@TestFor(MyController)
@Mock(Person)
class MyControllerUnitTests {
void setUp() {
mockDomain(Person, [
new Person(...),
new Person(...) ])
}
void testIndex() {
def model = this.controller.index()
...
}
}
17
Monday, 30 May 2011 17
18. The mixin approach
@TestFor(MyController)
@Mock(Person)
class MyControllerUnitTests {
void setUp() {
new Person(...).save()
new Person(...).save()
}
void testIndex() {
def model = this.controller.index()
...
}
}
18
Monday, 30 May 2011 18
19. The mixin approach (optional)
@TestFor(MyController)
@Mock(Person)
class MyControllerUnitTests {
@Before
void before() {
new Person(...).save()
new Person(...).save()
}
@Test
void indexAction() {
def model = this.controller.index()
...
}
}
19
Monday, 30 May 2011 19
20. Support for testing...
• Tag libraries
• Command objects
• XML & JSON responses
• File upload
• View and template rendering
• Filters
• URL mappings
• Criteria queries
• and more!
20
Monday, 30 May 2011 20
21. Grails 1.4
• Data storage
• Better testing
• User experience
• A better look
• A truly collaborative effort
21
Monday, 30 May 2011 21
22. 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
Monday, 30 May 2011 22
23. Plugin portal
+ Plugin usage tracking
+ Grails usage tracking
+ More info about plugins
How many We don’t know plugin?
people use each
Licence
Developers
Issue tracker
SCM
Dependencies (JAR & plugin)
23
Monday, 30 May 2011 23
24. 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
Monday, 30 May 2011 24
25. Grails 1.4
• Data storage
• Better testing
• User experience
• A better look
• A truly collaborative effort
25
Monday, 30 May 2011 25
35. 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
Monday, 30 May 2011 35