- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Scalatra vs Unfiltered vs Lift vs Play
Say I want to explore Scala web apps, and am comparing web
frameworks. The four in the subject are what I've seen first. Lift
was around for a long time and is big; others seem more compact by
comparison.
How do folks compare them for a simple project? I'd like to run it on
a cloud-hosted platform such as GAE, so interop with cloud is a plus.
But generally, what is the workflow which makes people pick
lightweight frameworks like Scalatra and especially Unfiltered versus
Lift?
Do people run Play with something other than Anorm back end, the
latter making incorrect claims against ORMs (hint: you can query
PostgreSQL about the schema ahead of time, cf. PGOcaml for example).
Specifically, what do you use to run on GAE?
Let's make it even simpler.
(a) Is there any reason to use Unfiltered for web sites other than
RESTful services?
(b) Is there any reason to delve into Lift for a simple web project to
explore Scala web apps instead of
(c) Scalatra or Play?
(d) so which is it, Scalatra or Play? (Typesafe's using Play for its
website, right?)
Cheers,
Alexy










Re: Re: Scalatra vs Unfiltered vs Lift vs Play
In fact, I think ultra light-weight frameworks like Scalatra are the way of the future as the make developing RESTful application extremely easy.
Which is not too say that full-stack frameworks and mid-level frameworks will disappear. Rather, I think thatif one is developing a client-heavy (Ie, Lots of JS) web app then something like Scalatra is probably going to be awesome to work with :-)
On 3 September 2011 11:19, Ivan Porto Carrero <ivan [at] flanders [dot] co [dot] nz> wrote:
Re: Re: Scalatra vs Unfiltered vs Lift vs Play
On Sat, Sep 3, 2011 at 11:19 AM, Ivan Porto Carrero <ivan [at] flanders [dot] co [dot] nz> wrote:
Sounds like an interesting idea!
--
Viktor Klang
Akka Tech LeadTypesafe - Enterprise-Grade Scala from the Experts
Twitter: @viktorklang
Re: Scalatra vs Unfiltered vs Lift vs Play
1) It's a bit bloated. Building a war archive of a "Hello world" app with the Scala plugin enabled gets you a 53 MB file! I'd love to have a way to strip stuff that I don't use like JPA-based ORM's, Anorm, Groovy, and whatnot. 2) It lags behind Scala releases. No Scala 2.9.x support yet.
By the way, Scalatra looks way cool. If I was starting my project now, I'd probably pick it.
Hristo
On Fri, Sep 2, 2011 at 10:38 PM, John Cheng <johnlicheng [at] gmail [dot] com> wrote:
Re: Scalatra vs Unfiltered vs Lift vs Play
Got to say unfiltered looks interesting ...
-- ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Brian Schlining
bschlining [at] gmail [dot] com
Re: Scalatra vs Unfiltered vs Lift vs Play
With regards to the Anorm component I am surprised to see so many people with negative opinions of it. As I understand it Anorm mostly just lets you query using SQL (Which is a pretty reasonable proposal if you ask me) and get back objects which are easy to work with. It's possible to do various other stuff with it, but the aforementioned feature is its key strength.
Whether or not you agree with the Anorm philosophy is just one of those things. Some people love top-heavy ORM systems and the supposed safety ropes they provide.Other people run into problem after problem after problem and just want something less long-winded. It's a matter of choice and I personally applaud Anorm for helping to provide that choice.
Overall, I like ORMs but think the programmers working with them should still have a firm grasp of SQL. Unfortunately this is not always the case :-/
On 2 September 2011 05:52, Brian Schlining <bschlining [at] gmail [dot] com> wrote:
Re: Scalatra vs Unfiltered vs Lift vs Play
Well that's exactly the way I would explain it. If you prefer ORMs, there are quite some choices in Scala, Anorm is about lightweight API that will allow you to do plain old JDBC nicely and doesn't assume you own your database (data lives more than applications) and assumes you want to use the full power of your database. Nevertheless, Play doesn't stop you from using ORMs.
--
www.sadekdrobi.com
ʎdoɹʇuǝ
Re: Scalatra vs Unfiltered vs Lift vs Play
??? Did someone say something negative about Anorm? My take was that folks were pointing out other persistence frameworks that have worked successfully. --
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Brian Schlining
bschlining [at] gmail [dot] com
Re: Scalatra vs Unfiltered vs Lift vs Play
--
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Brian Schlining
bschlining [at] gmail [dot] com
Re: Scalatra vs Unfiltered vs Lift vs Play
On 2 September 2011 07:02, Brian Schlining <bschlining [at] gmail [dot] com> wrote:
Re: Scalatra vs Unfiltered vs Lift vs Play
--
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Brian Schlining
bschlining [at] gmail [dot] com
Re: Scalatra vs Unfiltered vs Lift vs Play
You want to use JDBC -> Api is ugly and mutable -> you wrap it into a nicer safe api -> you want to support more types -> you add typeclasses -> you get overwhelmed with parsing the same structures the same way -> you add combinators -> you get Anorm
I hope this explains better the picture.
On Fri, Sep 2, 2011 at 7:47 PM, Brian Schlining <bschlining [at] gmail [dot] com> wrote:
--
www.sadekdrobi.com
ʎdoɹʇuǝ
Re: Scalatra vs Unfiltered vs Lift vs Play
No, I don't think you understand my point. My question is: Does Anorm support transactions? I found some discussion about it on this thread: https://groups.google.com/forum/#!topic/play-framework/qA6GyRn_eew but it doesn't look like Anorm allows you to explicitly demarcate transaction boundaries. You can add all the syntactic sugar you want to make it a type-safe, combinator filled, 'nicer safer' api. But without transaction support, it's just a toy framework that I would not put into production.
Just to be clear, here's why transactions are important:// initialize value in a databaseaccount.currentBalance = 100.00
// Run in thread A val a0 = account.currentBalanceval b0 = a0 + 100.00account.currentBalance = b0 // commit to database
// Run in thread Bval a1 = account.currentBalance val b1 = a1 - 100.00account.currentBalance = b1 // commit to database
The prize to anyone who can tell me what the value of account.currentBalance is in the database when both threads are run without transactions.
With that said, it looks like the Anorm authors are at least thinking about adding transaction support.--
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
Brian Schlining
bschlining [at] gmail [dot] com
Re: Scalatra vs Unfiltered vs Lift vs Play
For what it's worth, O/R Broker, which seems to build on the same premise as Anorm, does support transactions (and savepoints) and transaction isolation level support.
Re: Scalatra vs Unfiltered vs Lift vs Play
1) Very poor API documentation, frustratingly so. But this seems common in open source projects. (I'm a tech writer, so I'm picky about this.) 2) 2 Free books out and one electronic one in preview, all decent, none The One True Book. 3) Lift has evolved rapidly, and has tried out and discarded many ideas--this may be one reason it's larger. For example, its method for associating functionality with (X)HTML markup is very nice, but many examples still use the earlier method, which isn't as nice. You have to be sure you're doing things the right _current_ way. 4) Lift gives you fairly sophisticated user management for free. If you need to change the way it does that, it may be difficult, or it may be easy. 5) Highly responsive and active Google group.
Hope that helps.
Ken
Re: Scalatra vs Unfiltered vs Lift vs Play
* http://www.amazon.com/Definitive-Guide-Lift-Scala-Based-Framework/dp/1430224215 (Apress)* http://www.manning.com/perrett/ (Manning)* http://simply.liftweb.net/ (e-Book)
Re: Scalatra vs Unfiltered vs Lift vs Play
In Lift, there are two standard ORMs, Mapper and Record. (Like I said in my first post, there's been a fair bit of experimentation to find the best way of doing things.) I would say Mapper is easier to use, and is good for relatively simple things. If you'll be doing really complex queries, you can use squeryl with Record (or on its own--you don't need to use one of the Lift ORMs). Note that the previously mentioned user management features are implemented using Mapper, so if you use squeryl, you can't declare relationships or do SQL queries between the User table and squeryl/Record tables.
With a language like Scala, I want to be working at a higher level of abstraction, and Anorm seems to be going back to a lower level of abstraction. Oh well, just my opinion.
Ken
Re: Scalatra vs Unfiltered vs Lift vs Play
In fact, looks like folks were deploying Play onto GAE with Siena, so
I guess we don't have to use that A(b)norm after all.
A+
Re: Scalatra vs Unfiltered vs Lift vs Play
Definitely better, but I still like the promise of squeryl for SQL work.