Roo vs Grails

We had a requirement where we had an application in production and was developed in Spring MVC and the velocity of implementing new features were slow. We had to explore alternate frameworks like Grails and Roo. I personally spent close to a month exploring which one was better.

We explored following features in both these and below is our findings. We explored following features in both these and below is our findings. The final verdict is we have still not finilized on either one, we are still exploring

  • Support for database migration from existing application to these frameworks
  • Support for Spring Security with existing user authentication/authorization model for these frameworks
  • Support for standard features like reporting
  • Support for ajax frameworks like JQuery, Dojo, GWT, Flex

Both of these frameworks are well integrated with STS IDE. If you have to use these framework, configure STS IDE and start developing, dont use command line, you cannot take advantage of roundtrip code generation capabilities.

Roo:

This framework is 100% Java roundtrip engineering RAD framework which is used to develop any Spring application including web application using Spring MVC, and Ajax based views. The deal breaker here was, Roo was very buggy. It has addon for lot of tools like Jasper/ JQuery/Flex etc.. but most of them wont work out of the box with 1.2.1.RELEASE. It is wasy to build a simple prototype but build or reverse engineering enterprise web appliction is not easy. One aspect favorable to it is since it is Java based, people who understand Spring MVC, Spring Webflow etc, can take advantage of it.

Support for database migration from existing application to these frameworks:

In Spring Roo 1.2.1.Release database reverse engineering the database to DAO, DTO comes out of the box, the roo command is as below,

database reverse engineer --schema PUBLIC

Support for Spring Security with existing user authentication/authorization model for these frameworks

When you run the command security setup it will provide all the security plumbing including a login page and default spring security context file.

If you have to customize it, you need to configure in the spring applicationContext-security.xml file as below,

<http auto-config="true" use-expressions="true">
	<form-login login-processing-url="/resources/j_spring_security_check" login-page="/login" authentication-failure-url="/login?login_error=t" />
	<logout logout-url="/resources/j_spring_security_logout" />
	<!-- Configure these elements to secure URIs in your application -->
	<intercept-url pattern="/users/**" access="hasRole('admin')"/>
	<intercept-url pattern="/roles/**" access="hasRole('admin')"/>
	<intercept-url pattern="/userrolesmaps/**" access="hasRole('admin')"/>
	<intercept-url pattern="/" access="isAuthenticated()" />
</http>
<!-- Configure Authentication mechanism -->
<authentication-manager alias="authenticationManager">
<!-- SHA-256 values can be produced using 'echo -n your_desired_password | sha256sum' (using normal *nix environments) -->
	<authentication-provider>
		<jdbc-user-service data-source-ref="dataSource"     users-by-username-query="select email_id, password, active
		from custom_user where email_id=?"
		authorities-by-username-query="select u.email_id, r.name from custom_user u, custom_role r, custom_user_roles_map ur
		where u.id = ur.user_id and ur.role_id=r.id and u.email_id=?  " />
	</authentication-provider>
</authentication-manager>

Support for standard features like reporting

There is already an addon in Roo for Jasper reporting from gvnix, sadly this did not work out of the box, I had to write a new controller to plug into Jasper using Maven and write ton of code

Support for ajax frameworks like JQuery, Dojo, GWT, Flex

Again I was not able to make Flex work with Roo out of the box. Dojo comes bundled with Roo out of the box and it is Ajax enabled. Roo also works with GWT, but making Spring Security work with GWT was a challenge. There is no addon to JQuery.

Grails:

This framework is Groovy based, there is a learning curve involved for Java / Spring MVC developers to learn this new langauge, but let me tell you it is worth an effort. This is purely a web development platform. And among these 2 frameworks, this one is more stable and has better overall addon support with minimum bugs. There is also good JQuery /Ajax support.

Support for database migration from existing application to these frameworks:

There is a db-reverse-engineer addon, which can create a whole set of plumbing like Dto, Dao etc in Groovy

Support for Spring Security with existing user authentication/authorization model for these frameworks

It does provide spring security support with sample user authentication groovy code ready to be use, but if you want to configure it to work with existing schemas, it was not easy. And there is not lot of documents on the web to show how to implement

Support for standard features like reporting

Still exploring

Support for ajax frameworks like JQuery, Dojo, GWT, Flex

Still exploring

About these ads

6 thoughts on “Roo vs Grails

  1. Val Huber

    Valuable report – thanks!

    Regardless of how you come out on UI framework, you still need to address complex, multi-field/table business logic. We invite you to check out http://www.automatedbusinesslogic.com – declare your Hiberate/JPA business logic in annotations, enforced without codegen by our runtime engine that plugs into Hibernate events so no recoding is required.

    Reply
  2. Steven Shaw

    I wonder if you’ve since tried Roo 1.2.2? Apparently many bugs have been fixed. Perhaps you went with Grails in the end? Another worthy contender is Play!.

    Reply
    1. Krishna Prasad Post author

      Stevan, I remember trying it. For simple stuff Roo was awesome, for someone like me with java background, picking up on Roo and generating controllers views with single command was a boon. Where I hit the roadblock we in reports.. The roo’s reporting feature only worked with a particular version of Roo, I couldnt proceed further. Similarly Grails had its own problem, There was a learning curve to learn Groovy. I did not get a single Grails sample working out of the box. We still are continuing with Spring MVC, JSON/REST services..that looked clean.

      Thanks
      Krishna

      Reply
  3. Venky

    Krishna,
    What are you using for your front end currently? We have an application exactly similar to yours and face the slow development and messy front end as we use jquery to consume the json objects via rest services.
    We are thinking of moving our presentation layer to grails and use the rest layer from Spring. Can you provide your thoughts on this?

    Thanks
    –Venky

    Reply
    1. GoSmarter Post author

      Venky,

      If you are particular about Java than there are limited choices.. you can only use Spring MVC, Spring Roo, Struts or Seam. And all of them are poor choices with lot of coding to be written and cost of development is higher.

      We settled on Python, because our application is very algorithm/computation intensive. Ruby or Rails is another good option to consider.

      RoR is much more matured platform than Grails. One uses Ruby as a language and another uses Groovy.

      Krishna

      Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s