the blog for developers

Playing with Play Framework for Java

Recently I’ve been playing more seriously with the Play-Framework. Play is a newer rapid development web stack for developing web applications. My impressions in short: this is a very nicely framework for write applications, with much potential but which is at the very beginning. This means there aren’t awfully many features available (compare with Lift, also a recent framework for Scala on the JVM).

Good parts

The good parts I’ve found are:

  1. Java (JVM) based
  2. Aims for fun for developers
  3. Fast turnaround, automatically reloads Java classes, templates etc. which is one of the main gripes I have with Java, as stated in my “Java dead?” post:

    Rapid development and rapid turnaround. Java still falls flat, even with JRebel which allows seamless reloading of classes, RAD web frameworks like Wicket and splendid IDEs. Rails, Django and PHP are better and have a faster turn around. Period. Java is lacking here, and reloading changes look to be the biggest problem with Java development today.

  4. Real world developer oriented, not power oriented or hacker oriented. For example errors are shown in a nice way with the corresponding code in the browser.
  5. Error handling in Play

  6. Interesting modules available (Guice, Sass, GAE, OAuth), more Rails oriented than classic Java (which is a good thing!)
  7. No need to write getters and setters, they are automatically added. Another one of the gripes I have with Java
  8. Based on JPA, but other persistence like Siena supported
  9. Scala possible (Shorter, even nicer). Downside: Not as nice integrated as Lift, e.g. Option usage in Lift, composable attributes for domain classes
  10. Integrates Unit, Functional and Selenium (often aceptance tests) tests in one web page. Different testing styles can be used, e.g. JUnit with asserts, JUnit with should, Spec style and more.
    class SpecStyle extends UnitTest 
                          with FlatSpec 
                          with ShouldMatchers {
     
      val name = "Hello World"
    
      "'Hello World'" should "not contain the X letter" in {
        name should not include ("X")
      }
    
      it should "have 11 chars" in {
        name should have length (11)      
      }
    }
    

The things I don’t like so much

There were some parts during my playing around, which I didn’t like with Play:

  1. I would prefer the Lift (or StringTemplate) way of templating, with no code in templates (or the RIFE way)
  2. Not on the NoSQL bandwagon – NoSQL really is the future for some web apps I believe
  3. Wish it would use a build system, not for building, but for dependency managment, packaging etc (Gradle for example, or at least Maven).
  4. Not yet a big community, modules limited, high risk bet
  5. Minor one: Bazar? Wouldn’t have thought this is needed with Git and Mercurial, don’t want to learn a third competing DVCS

Overall an interesting new comer, which brings new ideas to the Java table. Definitely something to watch.

About the author

stephan Stephan Schmidt has been working with internet technologies for the last 20 years. He was head of development, consultant and CTO and is a speaker, author and blog writer. He specializes in organizing and optimizing software development helping companies by increasing productivity with lean software development and agile methodologies. Want to know more? All views are only his own. You can find him on Google +

Discuss on Hacker News Vote on HN