Tuesday, December 7, 2010

Rapid Java Development

Remember the 90's? Not many people knew about web 1.0, most people were still coding COBOL and C++ and Java was the newest and hottest kid on the block. At that time when my friends mentioned 'Garbage collection' they actually meant 'Garbage collection'.

Soon Java became everybody's darling. For thick client software applications you would use Java; after all it was the only truly platform independent solution. When the web took off a couple of years later Java servlets and struts were considered a robust and innovative solution for an online system.

Grails

Since then many software development frameworks have been developed around the Java platform (Swing, Struts, Spring, Hibernate, GWT, etc.). Microsoft even came up with its own completely independent.NET platform.

Today, Java is used to build highly robust, scalable solutions. J2EE is considered one of the most mature software platforms out there: Many of today's most critical applications are relying on J2EE on the backend and some Java based framework i.e. Java Sever Faces for the frontend. But let's be honest a lot of the initial 'sexiness' got lost.

When we talk to startups that have a business idea for the next Facebook or Twitter and we mention the word Java, we earn strange looks. J2EE development is perceived as extremely slow, when compared to rapid development frameworks such as Ruby on Rails or CakePHP; And from our experience that is true for the most part, but we also know that PHP and Ruby have performance and scalability issues, especially for larger deployments: Why would Facebook spend a good chunk of money to develop its own PHP compiler, or why is Twitter sometimes not accessible? Wouldn't it be great to marry the robustness and scalability features of a Java stack with the fast software development abilities of frameworks such as Ruby on Rails and CakePHP? There is a way and I personally feel that more software development organizations should know about it: Grails.

Grails is an open source software development framework maintained by the SpringSource Team. It increases productivity by applying the convention over configuration paradigm and the usage of Groovy, a dynamic language for the Java Virtual Machine. So it is safe to say that Grails functionality is similar to what frameworks such as Ruby on Rails or CakePHP are offering. The big difference however is that Ruby and PHP are interpreted languages and tend to execute slower than a compiled Java application and the fact that Grails is built on top of the robust and scalable Java stack (J2EE, Spring, Hibernate) lined out earlier, so all best practices for vertical and horizontal scaling are applicable to Grails as well.

Productivity - Granted, there is a learning curve for the Groovy language. But if you have solid Java developers or developers that are familiar with dynamic languages it should take them less than a day to get productive writing Groovy code. Your developers will be able to write more functionality in less code, which should translate into fewer bugs, hopefully. I mentioned that Grails applies the convention over configuration paradigm: For many applications your team will only have to define the domain classes and Grails will generate the corresponding controller and view for you, so you can focus on functionality rather than plumbing and configuration. Especially when you have developers working offshore this can be an important tool to increase not only productivity but quality of your code base as well, since everyone has to follow the conventions the framework imposes. In case you are tired to re-implement certain functionality such as security, electronic payment, etc. Grails comes with a decent library of plugins that make the implementation of these features a breeze. Grails also supports JUnit tests and has a plugin for functional testing, which lends itself nicely to Test Driven Development (TDD). Groovy can also integrate with JBehave to enable Behavior Driven Development (BDD). Make sure your team uses a tool such as SpringSource Tool Suite (based on Eclipse), with the Grails plugin or IntelliJ Idea to have an IDE that supports the Grails framework including the Groovy language.

Scalability - No one will argue that J2EE is an extremely scalable platform. With Grails using the same technology stack, applications become scalable as well, that assumes that you budget for it in your software architecture and design. Two great examples of this are the deployment of Grails applications in cloud environments such as Amazons EC2 cloud, Rackspace CloudServers and the Google AppEngine: Grails has a plugin to assist users with deploying applications directly on the Google infrastructure. This way you can easily scale out your application without a lot of configuration. The application is load-balanced using Big G's technology which includes the database (NoSQL). The deployment on Amazon EC2 or Rackspace requires a bit more configuration but you should be able to scale your application horizontally using the same strategies you would apply to any other web-based enterprise java application.

In my opinion Grails is really a game changer for web-based Java application development. It can increase your teams' productivity tremendously and at the same time result in an extremely stable product. Try it out, and leave a comment to let me know how it worked out for you.

Rapid Java Development

Android Development Tutorial Android Programming Tutorial

No comments:

Post a Comment