Griffon 0.9.3: New & Noteworthy - No Fluff Just Stuff

Griffon 0.9.3: New & Noteworthy

Posted by: Andres Almiray on August 15, 2011

The latest Griffon release (0.9.3) is ready for download!

This release comes with plenty of new features and bug fixes. The following is by no means a complete breakdown of all the things you'll find. Refer to the Release Notes to get the full list of items and issues fixed.

Let's start with the update that many were expecting to happen: the jump to Groovy 1.8. this particular version of Groovy comes packed with lots of improvements, as it can be observed in the release notes for 1.8.0 and 1.8.1. New AST transformations like @Log and @Canonical are now at your disposal; stop writing boiler-plate code when you can let the compiler do the heavy lifting ;-)

Next is the fully revamped Java support. For example, it's now possible to write a Griffon application with 98% Java code. All artifacts, lifecycle and event handlers can be written in Java source (or Scala, Mirah and/or Clojure for that matter). It's also possible to write a plugin/addon in Java as well. Even the jumpstart archetype has received a facelift. You can create a Java based application with this archetype using the following command

griffon create-app sample -archetype=jumpstart -fileType=java

If you look closely at the generated files you'll discover that every single one of the source files is Java based, except of the configuration files found in griffon-app/conf (though the general events handler is Java (Events.java)).

If you're keen of using an IDE for your Groovy development activities you may be aware that both IDEA and Eclipse have a feature that enables code suggestion for dynamic code. This feature is called GDSL and DSLD respectively. Griffon includes DSL descriptors for both technologies, allowing you to invoke code completion in View scripts and AST injected methods.

In terms of packaging, the application's manifest entries are fully customizable. You can define new entries and even rewrite standard ones. Single jar packaging had a problem when duplicate file paths were encountered. Most often than not the new file would be discarded and the old one kept. Well not anymore. You can specify a merging strategy per path using regular expressions. There are plenty of options to choose from.

Looking at the runtime enhancements, there's been a lot of work to make the size of the runtime library as small as possible. Griffon 0.9.3 is approximately 25% smaller and it even includes new features! For example there's a logging appender that translates logging events into application events, useful for routing a logging statement into a status console or display an error dialog when an error is logged. Building MVC groups is the bread and butter of a medium to complex application. Some of those groups are intended to be used in a short period of time and then be discarded. While doing so it's important to remember the lifecycle of a group. That or just use the new set of withMVCGroup() methods that relieve you of the burden of keeping tabs on the group's state. Here's one example, assuming that the group display is a Dialog based groupIn case you're wondering how this code would look in Java Byte code injection via AST transformations has become a staple of Griffon. All AST transformations have been relocated to package griffon.transform to keep them aligned with the transformations found in Groovy 1.8 (most of them living under groovy.transform). There are two transformations new to this set:
  • @ThreadingAware - injects the griffon.core.ThreadingHandler interface. Pretty much makes the class aware of Griffon's threading facilities.
  • @MVCAware - injects the griffon.core.MVCHandler interface. Allows the enhanced class to work with MVC groups as if it were a Griffon artifact itself.
Now, some of these enhancements and bug fixes come with a price. Griffon 0.9.3 breaks binary compatibility with previous releases as some classes were relocated, renamed or simply removed. It's worth mentioning that on the road to 1.0 all deprecated methods and classes will be removed from the codebase. It would be a good idea to review the list of breaking changes found in the release notes.

OK on to the last bits of release goodness. There are new plugins as well as updates to existing ones. Here's a quick summary:
  • Actions - automatic action management, complete with i18n customizations.
  • Lombok - apply AST transformations to Java code.
  • Datasource - multiple datasource support.
  • ActiveJdbc - lite ORM inspired in RoR's ActiveRecord.
  • Ebean - another lightweight ORM solution, supports JPA.
  • MyBatis - yet another lite ORM solution.
  • Carbonado - what?! another ORM solution? you betcha ;-)
While the updated plugins are:
  • Weld - enables addons to contribute beans to the BeanManager.
  • GSQL - leverages the Datasource plugin to provide multiple datasource access.
All in all this release raises the bar once more, paving the way for the highly sought 1.0 release. Many thanks to everyone that contributed issue reports, patches, questions and feedback. We look forward to your contributions, remember you can fork us at github :-D

Keep on Groovying!
Andres Almiray

About Andres Almiray

Andres is a Java/Groovy developer and a Java Champion with more than 20 years of experience in software design and development. He has been involved in web and desktop application development since the early days of Java. Andres is a true believer in open source and has participated on popular projects like Groovy, Griffon, and DbUnit, as well as starting his own projects (Json-lib, EZMorph, GraphicsBuilder, JideBuilder). Founding member of the Griffon framework and Hackergarten community event. https://ch.linkedin.com/in/aalmiray

Why Attend the NFJS Tour?

  • » Cutting-Edge Technologies
  • » Agile Practices
  • » Peer Exchange

Current Topics:

  • Languages on the JVM: Scala, Groovy, Clojure
  • Enterprise Java
  • Core Java, Java 8
  • Agility
  • Testing: Geb, Spock, Easyb
  • REST
  • NoSQL: MongoDB, Cassandra
  • Hadoop
  • Spring 4
  • Cloud
  • Automation Tools: Gradle, Git, Jenkins, Sonar
  • HTML5, CSS3, AngularJS, jQuery, Usability
  • Mobile Apps - iPhone and Android
  • More...
Learn More »