Friday, April 16, 2010

Discovering Griffon

 According to Griffon's homepage,

Griffon is a Grails like application framework for developing desktop applications in Groovy. Inspired by Grails, Griffon follows the Convention over Configuration paradigm, paired with an intuitive MVC architecture and a command line interface. Griffon also follows the spirit of the Swing Application Framework (JSR 296), it defines a simple yet powerful application life cycle and event publishing mechanism.

Why should I be interested in Griffon ? First of all, the project I've been working on for several years is based on Swing. Swing's pitfalls and inconveniences are no secret anymore, so I was curious to know how Griffon could help in developing Swing applications. Another reason is that I have never used Groovy yet, so I found this was a good opportunity to hit two birds with one stone, learning both Groovy by using Griffon.

I heard about the book Griffon In Action at JavaRanch, and decided to give it a try. The book, edited by Manning, is still in its MEAP phase, so only a few chapters are available. The chapters I have read so far are very interesting, and I was amazed by the way we could use Groovy and Griffon to develop Swing applications in a breeze.

I like the way the Model, View, Controller can access each other via implicit injections, and the way the Model gets bound to the View's components. Much easier than trying to access Swing's JFrame components. I also like the way the View is constructed with Groovy, although I wonder how messy this might become if we try to make screens made of a lot of components. I will have to spend some time trying to use Abeille Forms to make more complex screens.

Swing's Event Dispatcher Thread (EDT) is something we have to be particularly aware of, and this is no exception when using Griffon. But making things run in or out of the EDT is made somewhat simple via the SwingBuilder and its "edt" related methods.

I doubt that I will ever use Griffon at work, but I think it's still worth studying. I will try to illustrate some of Griffon's features in other posts.

No comments:

Post a Comment