Play Framework- First thoughts

This is my Yet Another Attempt to Learn Something New 😀

From the discussions here, I got to know about the Play Framework. So I started to play around- Hello World project, started the Sample project, going through the Framework documentation. So here are my first thought about the framework- And this is my first attempt to have gone a bit deeper into a Java Web Framework so I might not be able to appreciate the same features in other frameworks.

  • Totally inspired by Rails and of course Grails- Not much of configurations (expect the application configuration), based on convention over configuration.
  • No restart of server required after compiling Java changes- Framework compiles them on the fly and hot deploy the compiled classes. For that matter Java developers would be surprised to see that there’s is not folder to store the class files in the Application structure. The class files are cached in a tmp folder. In one of the stalls in one of the conferences I had heard about JavaRebel plugin which would had hot reload, it really didn’t inspire me that much at that time.
  • Pretty catchy error messages on the web page – With the line number and the exact errors being highlighted in the code snippet shown on the web page. This is possible due to the hot-reload when the framework can pick the error and throw it to the user via the web page.
  • And it uses Java- So you need not have to learn any new language- For Rails you would require Ruby, for Grails- Groovy.
  • For the Development mode- It comes with the complete stack- In memory DB , Application server, ORM layer and all other required plugins. Also one can install modules like- Facebook Connect, Facebook Social graph and so on.
  • You can hardly/not at all find the mention of Servlets anywhere in the framework. Also it follows the REST style. So you can have cleaner URLS. And no web.xml to configure your URL-Servlet mapping.
  • Good template for creating View pages- based on Groovy. Also provides an option to create an hierarchy of templates- Make one to extend the other template.
  • Good support for Development with Testing. One can write JUnit tests for the back end, Selenium tests for the view related tests.

This is a really different framework when compared to the conventional Java web frameworks. I have just started to learn this framework. Do drop in your thoughts/concerns about this framework. 🙂

Update:

Removed the concerns- As they were not applicable and were really not counted as concerns. All those gimmicks was during the development time.

19 thoughts on “Play Framework- First thoughts”

  1. It sounds that the only advantage of Play is on-fly compilation, which in fact is a technical detail of implementation.

    I suggest the next something you try to learn may be HybridJava.

    Reply
    • I like the Rails kind of implementation in Play.

      Are there any commercial applications build using HybridJava?

      Reply
  2. Not that I am aware of. But. Learning something really new, developing new commercial project and passing an interview usually need knowledge that overlap only partially. In office I have to continue development (Java) that started 10 years ago and apparently will continue using current technology for 20 years more.

    Reply
  3. Play Framework has a lot to offer besides on-the-fly compilation, Kenalex. You should try it 🙂

    Mohamed, AFAIK, Play doesn’t even rely on the Servlet spec at all.

    Hot-deployment in a production enviroment isn’t really a concern, as you just.. well.. wouldn’t do it 🙂 Hot deployment is for devlopment, and I don’t even think this feature is available when you deploy your release of a Play application.

    A VERY cool thing is that it also does not require a restart even when changing your JPA classes. That’s real developer productivity 🙂 They also have some very cool additions to JPA in their db-stack.

    Reply
  4. @Edvin
    1)
    “Play Framework has a lot to offer besides on-the-fly compilation”. Please name some others that are worth naming.

    2)
    “Play doesn’t even rely on the Servlet spec at all.” In what sense? It does not use any servlet inside?

    Reply
  5. //// What if my application has lots of Java classes- Say 500- A huge application? How is Play going to handle hot-reload in such cases? This will really increase the application response time? This would in a Production environment.///

    Play hot reload only works on development mode… not in production servers.. 🙂

    Reply
    • I forgot to correct the post before. Have updated and removed the 2 concerns. Thanks for reminding 🙂

      Reply
  6. Hi Mohamed,

    We are looking for reviewers for our book, Play Framework Cookbook, recently released by Packt. You can visit this book-page for detailed information: http://www.packtpub.com/play-framework-cookbook/book

    Based on this blog article, I am able to understand, through your interest in the Play! framework technology that you can be a potential reviewer for our book.

    If interested, I’d be glad to send you an e-copy of the book for reviewing. You can contact me on my email: jiteshg@packtpub.com

    Regards.

    Reply
  7. Pingback: JavaPins

Leave a Reply

Discover more from Experiences Unlimited

Subscribe now to keep reading and get access to the full archive.

Continue reading