Geertjan's Blog

  • September 15, 2008

Griffon: Identifying the Dark Underbelly of Java

Geertjan Wielenga
Product Manager
It seems to me that Griffon (brand new Groovy-based Swing MVC-structured framework) has identified the dark underbelly of the Java desktop world—there are no guidelines for how an application's sources should be structured. Two of the bloggers I read today on the excellent http://groovyblogs.org confirm this:
  • "Generally, I find the code very manageable, I look at xyzController in the controllers folder, I know its views will be in a directory xyz under views. Domain objects are again easily located and the dynamic CRUD support makes database interaction very straightforward. Another benefit is anyone who has used grails before has a much better chance of picking up the code, as they know where to look for things."

    From Grails and the power of code by convention

  • "MVC: By far, this was the area that benefited the most from the port. What began as a big clusterf—k all in one file has evolved to a nice separation of MVC. Thanks to @Bindable and changing from a concrete class as a view to a view clousure, I was able to eliminate some useless instance variables and move what needed to referenced from the view to the model."

    From Porting a Groovy app to Griffon

The latter comment is by one of the creators of Griffon, so he should know what he's talking about. Spend half an hour looking at the Griffon samples, try to make some of your own, revel in the coolness of Groovy, and then marvel at how manageable your application's source structure has become. Even better, lead your existing application back onto the path of righteousness (i.e., port it!) by following this article I wrote today on Javalobby. Griffon is to source structure what refactoring is to source code. Maybe a new term needs to be coined for source structure refactoring, because that's Griffon's (and Grails') main benefit, and—until you grasp that aspect—you won't "get" it.

The case for Groovy has been made a whole lot stronger via Griffon. If you want not just your source code, but also your source structure, to be clean and maintainable, then I don't think you've got much choice but to give Griffon a whirl. And you'll enjoy the ride since Groovy is so liberating!

Join the discussion

Comments ( 1 )
  • Alpha Tuesday, September 16, 2008

    Groovy and Griffon really is getting very interesting, it gets the job done quick. I think we dont need the JavaFX thing even JavaFX at this point doesnt have controls, they dropped swing for the scenegraph that is because the mobile market but there are millions of Java programmers that doesnt do mobile we just want a better way to do java desktop applications but I think JavaFX doesnt deliver, But Groovy with Griffon it delivers.

Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.