Question

I have worked with Django before and have recently seen the Play framework.

Is this the Java community's answer to Django? Any experiences with it? Any performance comparisons with other Java web frameworks?

Edit:Almost similar to this question, the responses, unfortunately don't say much about the framework.

Was it helpful?

Solution

Play! is a breath of fresh air into Java and bypasses all the Enterprise cruft that has evolved over the years. Even the namespace is just play not com.playframework. It is supposed to be an answer to Rails, Django etc and is MVC based. It is needed for Java to stay relevant in all but deep entrenched enterprise shops.

Play! reduces the overabstraction and painful configuration of old Java. It is a complete stack it does not rely or play to the old Servlet/EJB methodology like Restlet tried to do (making REST easier in Servlets). Play! is a great REST based Java framework that is a valid contender to other platforms MVC frameworks.

It is very RESTful and it is easy to bind a parameter to a java method. They have also made JPA much easier to use through their play namespace.

play.db.jpa.Model

public void messages(int page) {
    User connectedUser = User.find("byEmail", connected());
    List<Message> messages = Message.find(
        "user = ? and read = false order by date desc",
        connectedUser
    ).from(page * 10).fetch(10);
    render(connectedUser, messages);
}

Python is used for scripting instead of builds with Maven which might save a few lives.

I haven't been this excited about a Java framework since Red5 or Restlet. A bonus is they have easy ways to get your app up on Google AppEngine as well using the Java version of GAE.

OTHER TIPS

I have been using Play! now for a few months and in fact have come to love the framework. I struggled with Rails and Django a bit, mostly because I am really not a fan of dynamically-typed languages; however, there was never a really good web development framework for Java to compete with these. In terms of productivity, Rails and Django were the leaders for the MVC arms race that was going on. Play! is awesome, it's concise, scalable, powerful, and it has a great community that is growing all the time. If you're still really into using a language like a Python or Ruby, you can use Play! with Scala too. I am really trying to get into Scala right now because I think it has a great future and it's a lot of fun to use. Anyway, I would recommend giving it a try!

The Play! framework is a really good piece of software, and that the JavaEE bloated environment should be inspired from.

I moved from Java -> Django because of the fast cycle "modify file" / "reload browser", and the Play! framework makes me came back to my favorite Java language.

It could also be compared in some terms to what Grails and in general dynamic languages in Java (Groovy is used in Play!) are trying to import: simplicity, speed and reliability.

I am also a Django user. I've just visited the Play framework and skim thorugh its documentation. It has the simplistic design Django has been known of. It even has app engine support built-in. I'm sure many java developers will support it, and it only need some time to see cool plugins from the community.

We recently started using Play for building a webservice for various mobile applications. I come from a Java environment. I can tell you that the learning curve isn't all that steep--literally in an hour I had the webservice running with basic API already. One week later we were on Amazon Web Services. I definitely see a future for Play as it simplifies web development for Java developers.

Couple of things that I noticed however (asset versioning, etc.) still are not built into the framework, but i'm sure they'll be there in time. I would say it is definitely worth a shot using Play.

I come from a very strong java background. So my answer here could be a little biased.

Play finally brings to the java community what django has been for all these years in the python community, but just a way better. Play is built on the jvm therefore inheritance all the goodies from a solid platform that has been proving over the years to be the most reliable and scalable one that allows to write and run applications at scale.

I want to say that I did try django. Its popularity among the web community made me curios and I wanted to give it a try.

Strangely I did not find it as easy to use as I had expected. So many configurations. Too may libraries doing the same thing and often not play very well with each other. A way too much magic. Furthermore, not having type safety makes very hard to manage and maintain web application at big scale. Don't get me wrong, I am pretty sure that people managed to do it, but in my experience I still find java/scala best suited for this, especially when you share the code base with a lot of other developers.

IDE support for Java it is unbeatable. If you implement TDD you will find yourself refactoring code and moving things around on the daily basis. And java IDEs give you all this power. With type safety and more.

My take away is that as long as you find yourself writing a simple CRUD application/prototype/toy without even thinking too much of advanced features and big scale then you can probably find some advantages on using python/django. Otherwise the whole java ecosystem wins hands down. And play is the cherry on top.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top