Live data from Hacker News

Play Framework 2.0 Final released

playframework.org

41–50 of 61 posts

Re: Play Framework 2.0 Final released

#41

Their beta was incredibly buggy, riddled with compilation performance performance, slow load times, was really not a fun experience. I've heard they finally got development load times in check. I hope they get their deployment process a bit better then creating a zip file and having to run nohup on their start script.

It got to be pretty stable at RC3. I agree the beta was poor in a number of areas, but I've been consistently using the latest from GitHub for months now and would recommend you give it another go with this final release. They deployment story is the same, though I've filed some feature requests around this and I imagine this will be improved by the community as more people start using v2.

Re: Play Framework 2.0 Final released

#42
post #16
post #15

Earlier quoted context omitted.

Can you elaborate more on the untestable code point, for those of us who've been spending more time on ruby lately? I find play very interesting, but it's great to hear about its warts as well.

This is the first controller I opened from their samples[1] : public class Forums extends Application { public static void index() { List forums = Forum.findAll(); long topicsCount = Topic.count(); long postsCount = Post.count(); render(forums, topicsCount, postsCount); } ... } You can't mock out Forum, Topic or Post. You can't inject some type of "FormRepository" or whatever pattern you want to gain some type of con…

well, that's for play 1.

Re: Play Framework 2.0 Final released

#43
post #31

It's also now part of the Typesafe stack - here's the release announcement from the typesafe blog: http://blog.typesafe.com/introducing-play-20

Not much of a fan of the new Typesafe Stack. It doesn't seem to install the scala, play and akka command-line tools like the old versions did. Is there a way to get a straight Scala REPL, or does everything have to go through giter8 and sbt now?

You can get it directly from scala-lang.org:

http://www.scala-lang.org/downloads

Re: Play Framework 2.0 Final released

#44
post #4

When I did a bit of Play 1.2 dev, I ran into two serious annoyances. First, static actions make for untestable code. The only way to test this in 1.2 was to do full integration tests. You can't unit test controllers/actions, which to me is a horrible "opinion" to have. Looking at the docs, 2.0 [appears] to make an attempt via the callAction helper [1], but you still can't inject dependencies via a constructor and cal…

I agree about the testing. It is also really annoying that you can't run a test as a "single, isolated test". I read a few articles on Play 2.0 and Scala, but haven't come across any additions on testing. Without decent testing integrated, this framework has no real production use. I agree that it all looks nice and shiny though.

Some interesting criticism of Play here - seems similar to what's been said about the lack of unit tests.

http://whilefalse.blogspot.com/2012/03/why-im-moving-away-fr...

Re: Play Framework 2.0 Final released

#45
post #13

I am really excited about this but also a bit worried that Java will become a second class citizen for Play development. The typesafe deal, use of SBT and other scala tools, and the overhead of maintaining docs and bindings for 2 languages all seems to point to an inevitable deprecation of Java at some point. Hopefully not?

No need to be worried, the Java API is here to stay. We love Java (as well as Scala).

Re: Play Framework 2.0 Final released

#46
post #16

Earlier quoted context omitted.

This is the first controller I opened from their samples[1] : public class Forums extends Application { public static void index() { List forums = Forum.findAll(); long topicsCount = Topic.count(); long postsCount = Post.count(); render(forums, topicsCount, postsCount); } ... } You can't mock out Forum, Topic or Post. You can't inject some type of "FormRepository" or whatever pattern you want to gain some type of con…

If you wanted to unit test this I'm confident you could do it using JMockit [1] without changing the code. JMockit allows you to mock just about anything (static methods, final methods, constructor invocations). The unit test might look something like: @Test public void checkIndexRenders() { final List expectedforums= new ArrayList(asList(TEST_FORUM)); new NonStrictExpections() { @Mocked Forum forum; @Mocked Topic to…

Apologies for the tangent, but is this considered idiomatic Java these days? As a person who knows/knew Java pretty well but has been out of the game for a few years, this code seems highly surprising. Instantiating an anonymous subclass with a static initializer to... I suppose be able to use those @Mocked annotations. Then assigning result in that anonymous initializer block, which I must assume works through black magic.

No criticism of your code example. I think figuring out how to make Java do this is very impressive. I just wonder if it's considered wise to do this sort of thing in production code?

(Edited to correct that I don't think that's a static initializer block.)

Re: Play Framework 2.0 Final released

#47
post #13

I am really excited about this but also a bit worried that Java will become a second class citizen for Play development. The typesafe deal, use of SBT and other scala tools, and the overhead of maintaining docs and bindings for 2 languages all seems to point to an inevitable deprecation of Java at some point. Hopefully not?

I partially disagree, especially with backing from Typesafe. The "engine" benefits from Scala, as a highly concurrent and transactional heavy system. The choice of language for building MVC applications & services on that engine is left up to the developer. The 2.0 mindset, and you see this in everything is very much a best tool for the job balanced with flexibility and choice. It's going to take a little while for a…

> It's going to take a little while for a language like Scala (or any JVM based language) to fully penetrate the market.

By a wide margin, the overall consensus in the JVM community seems to be that Scala will probably never be more popular than it is today, which means, it will never become mainstream. Hopefully, one of Ceylon or Kotlin will succeed where Scala failed.

With that in mind, Play betting on Scala is quite a risky direction indeed.

Re: Play Framework 2.0 Final released

#48
post #44

Earlier quoted context omitted.

I agree about the testing. It is also really annoying that you can't run a test as a "single, isolated test". I read a few articles on Play 2.0 and Scala, but haven't come across any additions on testing. Without decent testing integrated, this framework has no real production use. I agree that it all looks nice and shiny though.

Some interesting criticism of Play here - seems similar to what's been said about the lack of unit tests. http://whilefalse.blogspot.com/2012/03/why-im-moving-away-fr...

Please note, this blog post is related to Play 1.2.X, not 2.0

Re: Play Framework 2.0 Final released

#49
post #4

When I did a bit of Play 1.2 dev, I ran into two serious annoyances. First, static actions make for untestable code. The only way to test this in 1.2 was to do full integration tests. You can't unit test controllers/actions, which to me is a horrible "opinion" to have. Looking at the docs, 2.0 [appears] to make an attempt via the callAction helper [1], but you still can't inject dependencies via a constructor and cal…

I agree about the testing. It is also really annoying that you can't run a test as a "single, isolated test". I read a few articles on Play 2.0 and Scala, but haven't come across any additions on testing. Without decent testing integrated, this framework has no real production use. I agree that it all looks nice and shiny though.

in play 2.0 (using computer-database java sample app):

  $ play
  [computer-database] $ test-only ModelTest

  or from the command line:
  $ play "test-only ModelTest"

Re: Play Framework 2.0 Final released

#50

Earlier quoted context omitted.

I partially disagree, especially with backing from Typesafe. The "engine" benefits from Scala, as a highly concurrent and transactional heavy system. The choice of language for building MVC applications & services on that engine is left up to the developer. The 2.0 mindset, and you see this in everything is very much a best tool for the job balanced with flexibility and choice. It's going to take a little while for a…

> It's going to take a little while for a language like Scala (or any JVM based language) to fully penetrate the market. By a wide margin, the overall consensus in the JVM community seems to be that Scala will probably never be more popular than it is today, which means, it will never become mainstream. Hopefully, one of Ceylon or Kotlin will succeed where Scala failed. With that in mind, Play betting on Scala is qui…

Not saying you're wrong, but says who? Can you point to evidence of this consensus?

I'm seriously asking, not trying to challenge you.

Post reply on HN