About Boni Satani

Boni Satani is a Java Technology Consultant working with Cygnet Infotech. He has undertaken various Projects in Java Web Application Development and J2EE Application Development including their maintenance and migration. You can connect with him over twitter @bonirulzz

The Pros and Cons of Play and Grails Java Framework

Frameworks simplify the process of application development by providing some helpful features to programmers. Java frameworks are often used by developers and thanks to their popularity; you can find a range of Java development frameworks in the market. Newbie developers often post a common question in forums, “which Java framework is the best?”

First of all, there is no one framework that is best because all of them have some advantages and disadvantages. Therefore, you must decide considering the project requirements. You must think about the key factors like scalability, complexity, deadline and, obviously, budget.

Today, we will discuss the pros and cons of two very popular Java frameworks- Play and Grails.

Play

It’s one of the best frameworks currently available in the market. Developers love it because it is easily programmable, scalable and powerful. Play is programmable in Scala language.

Let’s take a look at some of the major features of Play.

Developers often make small changes in coding during the development and testing phase to identify the best possible solution. Generally, they need to restart the system to see the changes they have made. However, if you use Play, all you need to do is refresh the browser to see the recent changes immediately.

It has only one XML file for configuration and thankfully, most of the configurations are either default or automatically set.

It does not use Servlets API. Therefore, developers can use hot swapping.

What are the advantages?

It allows you to develop faster so that you can work on multiple projects at the same time and deliver all of them within deadline.

Testing the application is very easy and testing provides authentic results.

The user interface is intuitive.

What are the disadvantages?

Scala is a complicated programming language and thus, novice programmers may not feel very comfortable using it.

It does not offer backward compatibility. For example, Play 2 is not compatible with Play 1. So, if you are planning to migrate to an existing app, you have to do all the tasks once again.

It’s hard to understand the architecture and things going behind the scene.

There are lots of plug-ins but they are not stable.

Grails

It’s another open source Java development framework. Grails is built upon Hibernate, Spring and SiteMesh. It utilizes Groovy as the coding standard and since Groovy is similar to Java, programmers think it is easier to begin with Grails.

Let’s take a look at the major features of Grails.

You can use the same codes repeatedly to perform different actions and save time.

XML processing is easy.

What are the advantages?

It provides a rapid development cycle.

If you are dealing with a small or medium-size project, Grails is ideal for you.

The framework offers a range of plug-ins to make your ob simple.

The documentation is really impressive.

The setup process is very simple. Therefore, you should be able to start building an app in an hour.

Simple GORM. It may take some time to learn but once you are familiar with it, it’s absolutely wonderful.

You can see the changes by hitting the refresh button.

Less CSS framework plug-ins. Hence, it’s easier to manage the CSS.

Dynamic configuration feature. Therefore, you can change the configuration without server restart.

What are the disadvantages?

You have to deal with runtime language. Its negative quality is that it is error prone and you have to bear with other cons of runtime language.

If you are working on a multi threaded app, GORM can be problematic for you.

You have to buy IntelliJ Idea because other IDE’s either don’t have or provide limited support.

Developers generally declare variables with “def” which is equivalent to “object”. It’s very hard to maintain.

Interpreted languages increase weight and that directly affects the run time.

You must learn Groovy coding.

It works with GORM but not with any other ORMs.

Integration process is complicated.

So, as you can see, both frameworks have some pros and cons. Therefore, you should not rely on other people’s opinions. Choose either Play or Grails considering the requirements of your project.

It is ridiculous that you say you must buy intellij to get use grails. The official ide which is based on the spring tool suite(which is based on eclipse) has many features and works great for grails development. Telling people they have to pay money to use it would keep them from even trying grails and creates a very unfair analysis of pros vs cons.

Stop doing comparison of frameworks if at the last all you can say is “Choose the framework according to your project requirements”. At least give the readers some examples and scenarios like for which type of projects you should choose playframework and for which type of projects you should go for grails.

“Boni Satani is a Java Technology Consultant working with Cygnet Infotech. He has undertaken various Projects in Java Web Application Development and J2EE Application Development including their maintenance and migration.” ¿WTF? It’s the worst analysis I read in months……

“Interpreted languages increase weight and that directly affects the run time.”

You can compile and run grails. it is lot faster than grails run-app.

“You must learn Groovy coding.”
Groovy is way more easy to learn than Java.
You could mix your code between Groovy style and Java style. That’s the advantages I think.

“You have to buy IntelliJ Idea because other IDE’s either don’t have or provide limited support.”
Springtools suite offered for free.
I use VIM for many years. I use Intellij Idea recently *just bought it for 3-4 months and sometimes I still using vim for my grails projects.

“There is no best framework, there are some awesome choices”. Choose the one you are comfortable with and works for you. I am using grails, it works for my mid size project, where performance is not a big issue. For high throughput application go for Play with Scala.

It is nice to see “the facts” for some frameworks, but the new generation of programmers forgot to see the important facts of programming and that is performance. That are facts I am really missing here like compaikm, j^ CPU, Ram, etc. Of course you can use frameworks which are always have to use generics, but I think you will have more overhead. But I agree that the frameworks are interesting ti create more flexible applications with a good library base of java and then you can extend or change the requirements on the fly.

I would say probably start with Grails. The real advantage of Grails is you can really quickly create a working application without going having a deep understanding of the Java stack. Play is really cool, but scaffold something up in Grails then migrate to a front end MVC you can get the best of all worlds.

Join Us

With 1,240,600 monthly unique visitors and over 500 authors we are placed among the top Java related sites around. Constantly being on the lookout for partners; we encourage you to join us. So If you have a blog with unique and interesting content then you should check out our JCG partners program. You can also be a guest writer for Java Code Geeks and hone your writing skills!

Disclaimer

All trademarks and registered trademarks appearing on Java Code Geeks are the property of their respective owners. Java is a trademark or registered trademark of Oracle Corporation in the United States and other countries. Examples Java Code Geeks is not connected to Oracle Corporation and is not sponsored by Oracle Corporation.