Core Java

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-vs-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.

  1. 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.
  2. It has only one XML file for configuration and thankfully, most of the configurations are either default or automatically set.
  3. 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.

  1. You can use the same codes repeatedly to perform different actions and save time.
  2. 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.

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
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

12 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Soroosh Sarabadani
Soroosh Sarabadani
10 years ago

In Play framework you can use java language and you are not restricted to use scala!

Caleb holt
Caleb holt
10 years ago

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.

wolkott
wolkott
10 years ago

Grails also works very well with hibernate mapped/annotated classes so you are quite incorrect in saying it does not work with any other ORM.

Rajesh Rao
Rajesh Rao
10 years ago

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.

Eduardo
Eduardo
10 years ago

“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……

Birendra Dhami
Birendra Dhami
10 years ago

What a bad analysis. Your article clearly says you are against Grails.

adwin
9 years ago

“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… Read more »

Daxyonis
Daxyonis
9 years ago

I support the fact that you can use Java code in Play.

For a thorough analysis of Java web frameworks, check out the report here:
http://pages.zeroturnaround.com/RebelLabs-AllReportLanders_The2014DecisionMakersGuidetoJavaWebFrameworks.html

Prosanta Ghosh
Prosanta Ghosh
8 years ago

“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.

http://www.slideshare.net/mraible/comparing-jvm-web-frameworks-devoxx-france-2013?next_slideshow=1

Helge
Helge
8 years ago

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.

Don
Don
8 years ago

I have lot of experience wih php and want to learn java and java web framework . Should i use grails?

Mike
Mike
8 years ago
Reply to  Don

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.

Back to top button