سؤال

One of the strongest selling points of play framework is it's development cycle, just fix the code, go back to your browse, hit reload, and go one, all without the write, compile, deploy, hassle typical of j2ee web development.

Nevertheless, for web developers coming from php, ruby or python this is hardly surprissing, moreover it's considered the natural way to develop web apps.

Moreover, many of the advantages of play, (efficient template system, resolve errors quickly, stateless, fun & productive) are taken for granted in those frameworks...

So I'd like to know what do you think are the main advatages that play framework brings to web developer coming from dynamic languages.

هل كانت مفيدة؟

المحلول

From my point of view these are the main advantages

  • it's java, so if you don't feel confortable with java, and you are not willing to learn it, that might not be an advantage. On the other hand, if you HAVE to use java, coming from php or rails you will feel right at home with play

  • it's static (except for templates and routes, that's about to change on the next version), so you have compiler checks and safe refactoring.

  • tool support: IDE support (eclipse, intellij, netbeans)

  • endless collection of libraries to do everything you want, well, it's just java

  • runs on the jvm, which has years of experience and optimizations

  • it's compiled, so you may expect better performance

  • it's really fullstack: it comes with everything you need to develop a web app, compiler, web server, in memory db server, offline documentation, integrated database manager, local and distributed cache management, fixtures, evolutions, dependency management, lots of utility libraries, unit tests, selenium tests, ide support. You need no apache or mysql setup to get up and running

  • it has advanced features, like asynchronous requests, web sockets, asynchronous jobs

  • zero development environment setup: just unzip play.zip, play new my app, play run myapp

  • excellent documentation

  • great and fast growing community

  • scala is firmly in it's horizon, if you come from a dynamic language you might feel more comfortable with a language like scala, even though it's static

  • can be deployed to any servlet container, like tomcat, but also comes with it's own lightweight server

  • it's got an ever growing collection of community contributed modules

  • it's cloud friendly, works on gae, heroku, playapps, cloudbee, dotcloud, etc... (see this question)

  • source code: this is one of it's main advantages, even though it's often neglected. The source code is pretty readable, understandable and not over engineered. Even without much java knowledge, it's possible to have a look at the code, understand it, and begin contributing to the project

In my particular case, coming from a php & classic asp background, play allowed me get a web application up and running while learning java at the same time. it really let me enjoy my transition from dynamic languages to java...

Play has some advantages compared to other dynamic web frameworks, but I think that if you are proficient in codeignter, rails, django, etc, and if you are not willing to benefit from java's (or scala) ecosystem, you should stick to what you know...

نصائح أخرى

A similar debate has been running on Google Groups recently, but more specifically comparing Play and Ruby (on Rails). I have tried to collate some of the feedback the community has provided on this topic, rather than just give me personal view. Hopefully this will make for a more rounded answer!

  1. statically types business logic layer (and using the new templating engine, even your views will be statically typed). This has therefore the advantage of better IDE support as well.
  2. Can use Java as well as Scala, so you are not restricted to a single technology stack.
  3. Play just works out of the box, but is also highly configurable, so does not force you to work in a particular method.
  4. In memory DB. Great for new developers, who just want to get started. No need to go through setting up WAMP/LAMP server etc, just to get started. Just download play, and you are ready to go!
  5. Its Java (or Scala)! I got hooked on Play because I used PHP begrudgingly because it was the easiest way to host a personal website, but hated that I was building software in a way that I did not feel was well structured. Play allowed me to use Java without the bulk of a J2EE application.

Play framework. Play is heavily inspired by Ruby on Rails and Django. A developer familiar with any of these frameworks will feel at home.

1) Play leverages the power of Java to build web applications,By lifting away the Java EE constraints, Play provides developers with an easy-to-develop and elegant stack aimed at productivity.

2) It focuses on developer productivity and targets RESTful architectures. Play is a perfect companion to agile software development.

3) Folder structure of the play mostly match with the Rails.

4) Play loads the code dynamically. Just fix the bug in Java file and hit reload, the change will get reflected instantly on webpage. No need to go through those sluggish rebuild / deployment / server restart.

5) No configuration: No configuration required just download, unpack and start development.

6) Error discovery is very easy, When an error occurs, play shows the error message, the file path, line number, and relevant code snippet right in the browser.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top