Archive for the ‘grails tools’ Category

2010 SpringOne 2GX Groovy/Grails Session Notes

October 24, 2010

The notes here are from 10000-ft view and some statements are merged from multiple sessions.

* Externalized configuration of  Config.groovy

grails.config.locations = [ “classpath:${appName}-config.properties”,
“classpath:${appName}-config.groovy”,
“file:${userHome}/.grails/${appName}-config.properties”,
“file:${userHome}/.grails/${appName}-config.groovy”]
This way, you may remove production login/password from source control, along with  environment specific information from WAR.

* liquibase (www.liquibase.org) for database migration management.

* Securing JMX/VisualVM operations in production environment

* GORM may not completely shield you from Hibernate
http://blog.springsource.com/2010/06/23/gorm-gotchas-part-1/ lists some common issues

* Performance tuning (warning: avoid premature tuning)
– tools
Easiest one is to download tc-Server/Spring Insight and drop your war to see which operation is slow.
Other tools include Profile Plugin, Hibernate logging, p6Spy at server side, and Chrome speed tracer and Firefox ySlow at client side.
– fixes
Database queries tuning, Service/View tier Caching(springcache plugin), Async. calling, Http tier tuning, such as “static resource” plugin

* NOSQL development
NOSQL may provide better scalability and easier domain object mapping compared with RDBMS in some emerging data processing applications, but it is currently still in some sort of hype stage.  RDMS will remain to be the core persistence platform for long time to come. The NOSQL applicability is based on the application requirements of Consistency, Availability and Partition-tolerance. See http://bit.ly/cap-theorem-proof for details. It likely will take many more years for NOSQL to mature.
Grails currently provides Redis and GemFire NOSQL plugins and more are coming.

* Grails release updates in short and medium terms
– Groovy-1.8, Spring-3.1 and Hibernate-3.6 upgrade
– Agent-based reloading to improve performance
– Better static resource management
– NOSQL and RabbitMQ
– Rest client and server enhancement
– JQuery and Flex
– Gradle Build
– Spock and Jeb testing support

* Groovy programming language
– Compile time meta-programming via AST transformation. @Singleton and @Immutable etc annotations are classical examples.
– Run-time meta-programming via ExpandoMetaClass. myPerson.save() and Person.findByLastName(“Mylastname”) etc domain class persistent methods are typical examples.
– Performance has been improved greatly in the last few releases, but more are coming. Some audience still concerns the issue, such as bootstrap-startup time etc.
– Better modularization to allow customized and more efficient run-time deployment for different kinds of applications.

* Groovy concurrency
– At its core, java concurrency is the foundation, such as jetlang, jppf.org, gruple, gridgain, multiverse etc. IBM’s http://alphaworks.ibm.com/tech/contest remains the only thread testing tool to help improving thread safety.
– GPars is a new tool to help simplify Groovy/Java concurrent tasking implementation.

* Spock unit testing framework
Implemented mostly via Groovy compile-time meta-programming(AST transformation), it claims to be state-based, data-driven and behavior-based testing. It also supports extension for testing customization and enhancement.
However its core implementation is still based on jUnit spec and does not support parallel unit testing yet(It may come in the upcoming 1.0 release).

* Gradle build tool
It’s aim is to combine best features from both Ant(simplicity and control) and Maven(dependency management). It’s using closure syntax DSL for build scripting. For now the adoption is limited as the release is not 1.0 yet and lacks IDE support.

* Git repository
Single word: distributed repository management tool with core operation as add-commit-push. Its underlying tools allow better parallel development and changes/cloud-support management.

* AMQP/RabbitMQ
Protocol-based messaging tool to allow diversified clients interaction. RPC call via direct-exchange. No pre-determined content-type for messaging payload.
No embedded MQ yet for writing unit/functional tests. Clustering support for high-availability operation is in the works.

* Mobile development
– Server side using Spring-Mobile/REST Service
– Client side is all native code and no write-once-run-everywhere. Today is iPhone(you need a Mac) and tomorrow is Android, with Windows mobile 7 and Blackberry are wild-cards. Palm/WebOS may survive via tablet push by HP.
PhoneGap and Appcelerator/Titanium are two major CSS/javascript based cross platform development tools, with native wrapper to deploy the app to target native device. It’s unclear on future direction how the cross-platform standard may playout.