Grails for Struts Developers: A Groovy Alternative
Struts is the defacto web framework for Java web developers. It has been with us since 2001. Struts enjoys unprecedented success – most surveys place its market share between 60% and 70%. It introduced a whole generation of web developers to the phrase 'MVC' (Model / View / Controller).
Grails 1.0 was released in 2008. It marries the modern features of Rails with the need for legacy support for Struts. Grails is inspired by Rails, but it is not a simple port of the project to Java. It takes the ideas of Rails, but expresses them in familiar Java libraries like Spring and Hibernate. It also leverages a new dynamic language for the JVM called Groovy.
In 2004, Ruby on Rails added some new phrases to the industry like 'scaffolding' and 'Convention over Configuration'. While these concepts helped ease the pain of traditional Struts development, they added a bit of a wrinkle: Rails wasn't implemented in Java, so the developer was forced to learn a completely new programming language. This had a ripple effect new IDEs, new web servers, new supporting libraries to learn, and on down the line. While greenfield development was a breeze in Rails, supporting legacy Java applications was relegated to high-level integration technologies like Web Services and shared databases. The views and business logic had to be rewritten from the ground up in the new language.
Many of Rails early successes were with brand new websites built from scratch. This talk, however, is targeted at developers who have successful Struts applications already in production. We'll start by using Groovy to strategically ease the pain points of an existing Struts application. Your organization might decide to stop there. However, we'll begin migrating one portion of the Struts application at a time into Grails until we eventually have something that is ready for the 21st century. Who knew that Struts development could be exciting again?
About Scott Davis
Scott Davis is the founder of ThirstyHead.com, a training company that specializes in Groovy and Grails training.
Scott published one of the first public websites implemented in Grails in 2006 and has been actively working with the technology ever since. Author of the book Groovy Recipes: Greasing the Wheels of Java and two ongoing IBM developerWorks article series (Mastering Grails and in 2009, Practically Groovy), Scott writes extensively about how Groovy and Grails are the future of Java development.
More About Scott »