Monday, December 31, 2012

Spring Java-based configuration

From Spring 3.0, we can configure our Spring application with a new way: Java-based configuration. With Java-based configuration, you can migrate all XML configuration files to configuration Java class. With that, you can avoid typing errors and enjoy the programmatic features. Though some IDEs, like Intellij IDEA can make you away from typing errors, but with Java-based configuration, you can enjoy this feature on all of IDEs, even with text editors.

In my opinion, Spring configuration best practice is use Annotation configure your own code. For 3rd party classes, Java-based configuration is a good choice.

The following are some samples from Spring 3.0 Documentation.

XML-based configuration load Java-based configuration
Java-based configuration load XML-based configuration
Specifying bean scope

Saturday, January 17, 2009

An Demo App Developed with Grails

This demo app simulates the "Booking" example in Seam Framework, but developed with Grails, an all-in-one framework based on Spring, Hibernate and Sitemesh. Grails is inspired by ROR but more powerful because the supports of Java frameworks and Groovy.

You can find the source code in Google Code's SVN. Anyone interested in Groovy, Grails and Seam can communicate with me.

The next step plan is to rewrite the 'seambay' example of Seam Framework in Grails.