What are some of the biggest issues/pitfalls with using the Grails framework? I'm learning the framework now, and I really like it, but I need to know what major issues I may encounter when using it and how to avoid them.
IMO, the weakest part of Grails has been the lack of data model migration functionality (ala Rails ActiveRecord migrations). There were some 3rd-party plugins of varying levels of quality, but nothing official.
However, I just discovered that Liquibase has been extended and turned into the database-migration plugin, and that looks promising: http://www.grails.org/plugin/database-migration
On the plus side, for everything I've used Grails for (simple-to-moderately complex web apps), it has been mostly fantastic. I'd say I can get roughly a 2x to 3x increase in development productivity over a Java/Hibernate/Spring/Spring MVC stack.
1+1. I chose Grails for further work on a poorly written Struts 1 application. The only tricky part for me was sharing cookies across the two servlets. Otherwise it has been a total win. Mar 4, 2012 at 19:40
Running the integration tests were slow as the grails environment takes time to load and only a fraction of that time is required to run the test. This will increase the turn around time when you are developing code which writes to the db. The other problem has already been mentioned by Kaleb in his answer (about the data migration). I also found that whenever I was stuck, the no of forums I could get help was limited when compared to the help available for hibernate and spring.
Running tests: just run them in interactive mode - this way you avoid the start up Aug 4, 2011 at 18:43
3forums: my experience is that I get an answer to all my questions within 4 hours on Stackoverflow - mostly direct from the grails committers... Aug 4, 2011 at 18:44
A current pitfall to using the framework is its current poor integration into the gradle build system. It currently uses a plugin to accomplish this, but the plugin itself breaks with new versions of grails (as I have recently tried to use and to fix). They plan to fix this problem in future version by making gradle part of the grails build system (instead of gant), but the lack of an build system that you can easily integrate is a problem. However, this pitfall will go away in the future.
Another pitfall is the dynamic nature of the language. You really MUST write tests for everything. Most of the errors in your code are found at runtime. It is really a different way of thinking about a program. Reliance on the compiler to find some of your mistakes do not happen with this framework. I'm not saying it is bad, it's just different (and a pitfall if you're not familiar with it).
I like whole grails/groovy concept, although I personally have used plain groovy more than grails I think they are both splendid.
The only downside (in my personal experience) is poor IDE support. I thought (rather optimistically) that as SpringSource had an excellent Eclipse build and were strong supporters of Grails that this would be the way to go. The groovy plugins are difficult to install, code completion is flaky (always a problem with dynamic languages but giving me a choice of 60 methods isn't that helpful), debugging can be tedious as it often requires steping through groovy's internal code, and, in the latest release installing the groovy plugin breaks the Java debugger!
Currently it has iffy support for abstract classes. For instance, you can't bind a list of implementations into a single
List<T> in a command object. Granted, this is primarily annoying because I'm used to it magically binding everything else! :D
Generally it's still just kind of "green"; you eventually run into odd little limitations and bugs. It's really come a long way in a few years though.