• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between Play for Scala vs Scalatra

 
Tony Hsieh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was confused with first using Play (2.0) for Scala (though I admit I was trying to learn Scala at the same time) so I have gone back and focused on learning the language first.

Now after the Coursera class, I'm slightly better armed to take on Play - at least syntax-wise.

I now hear about Scalatra as a simpler-to-grok framework.

With so many things to learn and so little time, what is the difference between the two frameworks?

Is Play for Scala harder to learn but ready for industrial strength site and Scalatra simpler to learn but more for less scaling "toy" sites?

Any thoughts would be great!

Thank you
-- Tony
 
Erik Bakker
author
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tony Hsieh wrote:I was confused with first using Play (2.0) for Scala (though I admit I was trying to learn Scala at the same time) so I have gone back and focused on learning the language first.

Now after the Coursera class, I'm slightly better armed to take on Play - at least syntax-wise.

I now hear about Scalatra as a simpler-to-grok framework.

With so many things to learn and so little time, what is the difference between the two frameworks?

Is Play for Scala harder to learn but ready for industrial strength site and Scalatra simpler to learn but more for less scaling "toy" sites?

Any thoughts would be great!

Thank you
-- Tony


Note upfront: I don't have any experience with Scalatra, so the remainder of this post is guesswork ;)

I think the main difference is that Play is more of a full-stack solution, with a bunch of built-in or at least recommended components, while Scalatra provides only a core and relies on you choosing the third party libraries of your liking for many tasks.

I don't think that any of the frameworks is particularly harder to learn.

Given that Scalatra has a very similar architecture, I think it will scale just as well as Play, and it's certainly not just for simpler or toy sites.
 
Tony Hsieh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply, Erik!

I bought your book as a direct response after flailing with Play. I'm going to use my willpower to work through your Play for Scala book before I switch over to something else like Scalatra.

Thanks again for your response, Erik!
-- Tony
 
Dave Hrycyszyn
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I'm chipping in late here, but I have a few things to add to what Erik said (all of which I agree with by the way).

First, it's important to say that there are quite a few similarities. Obviously, both promote Scala as a first-class language. Both have books available, e.g. there's Play for Scala and Scalatra in Action. Both frameworks are fast, with Scalatra probably having a speed edge in (mostly meaningless) benchmarks. Both are routinely used by very large organizations that want to scale massively.

The most obvious difference between the two frameworks, as Erik said, is that Play! is a much more full-stack framework, and does a lot more convention-over-configuration for you - so it provides convenience with the trade-off that it makes more assumptions about your application's setup.

In contrast, Scalatra tries to provide a very small set of core routing functionality and then let you easily layer whatever other libraries you want on top. In our view (I'm a Scalatra contributor), this is good thing as it gives you more freedom to structure things the way you want. I like Scalatra because it makes it easy to write multiple small applications with well-defined purposes.

There is another difference which may be somewhat less obvious but is still very important: deployment.

Play! is usually deployed using Netty (I am not sure of the status of its external WAR plugin at this point, maybe somebody else can comment on that). Scalatra only deploys on regular servlet containers (Tomcat/JBoss/Jetty/whatever), so if you need to deploy your app that way, it might make a difference to you. Each has its advantages and disadvantages.
 
chris webster
Bartender
Posts: 2407
32
Linux Oracle Postgres Database Python Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the expert input, Dave, and good luck with the Scalatra In Action book!
 
Tony Hsieh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Dave, for your response! I do like the thought of a framework with slightly less "magic" (...because sometimes Scala itself feels like it.)

Now you are tempting me to buy your Scalatra in Action book as well!

Thank you again!
-- Tony
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic