

Akka, Spray and Play to come Together - michaelpnash
http://scalalearn.com/akka-spray-play-come-together/

======
danieldk
This was covered by Typesafe's announcement. The linked 'article' seems to be
spam for the author's books. The fact that the submitter is the author of the
blog post and had no karma before posting doesn't bode well.

------
djKianoosh
I like the "philosophy" section on the Spray site:
[http://spray.io/introduction/what-is-
spray/](http://spray.io/introduction/what-is-spray/)

It speaks nicely to what it should and shouldn't be used for at a high enough
level that people new to it can understand quickly.

------
TylerE
Now if only they had a decent DB library/ORM. (And no, Slick isn't it)

~~~
jhuckabee
I've just recently discovered Slick only by noticing it performed quite well
in TechEmpower's last round of benchmarks. So I'm genuinely curious, what's
wrong with Slick?

~~~
terhechte
I recently learned Slick, and it was a hellish ride. First of all, a large
part of the problems I had were an unbelievable terrible documentation.
Sometimes, in order to do even the simplest things, I had to look into
particular unit tests deep within the sources of the project, or follow
stackoverflow discussions with multiple proposals, only one of which actually
worked. Oftentimes this was for things which I considered granted and
implemented. The certainly best example is getting an object by id. I would
have thought that this, being the most basic operation, should be possible
through some kind of default operation like "get" or "getById" or "objectById"
or something else. Instead, you have stackoverflow answers like this:

def findById(userId: Int)(implicit session: Session): Option[User] = { val
query = for{ u <\- Users if u.id === userId } yield u query.firstOption }

[http://stackoverflow.com/questions/16461260/select-single-
ro...](http://stackoverflow.com/questions/16461260/select-single-row-based-on-
id-in-slick)

However, that's not even the brink of the iceberg. Try finding out how to
update multiple fields in an object. Say you retrieve a User object, and you
want to set a new email, zip, and address. I'd suppose, this would work with
simple getters and setters, i.e.:

user = Users.get(user_id) user.email = new_mail user.zip = new_zip
user.address = new_address

Instead, you have to do this:

val map = Query(User) .filter(_.id === user_id) .map(ab => ab.email ~ ab.zip ~
ab.address)

map.update((new_mail, new_zip, new_address))

And even that only works with updateable result sets. See:
[http://stackoverflow.com/questions/16757368/how-do-you-
updat...](http://stackoverflow.com/questions/16757368/how-do-you-update-
multiple-columns-using-slick-lifted-embedding)

[https://groups.google.com/forum/#!msg/scalaquery/ML56aZAfy3g...](https://groups.google.com/forum/#!msg/scalaquery/ML56aZAfy3g/nx-
PPV1y2dEJ)

Or, to quote from the stackoverflow answer above: "Typesafe, why your
documentation is so bad ? I have to Google pretty much every silly thing or
dig through unit-tests for hours. Please improve it. Thanks."

Now, after a lot of searching, I found solutions to all of my problems, but it
took a long time, lots of Google, and almost nothing came out of their awful
documentation.

~~~
runT1ME
This looks great. Seriously all of the answers you give seem simple and
convenient ways of doing things.

You could reduce your first example to def findById(userId: Int)(implicit s:
Session) = Users.filter(_.id === userId).firstOption

~~~
terhechte
Certainly true, but when you're just starting out, that kind of thinking may
not be there yet. You need some time with Slick to understand this, and it is
difficult to get into it because it lacks the simple facilities. I actually
spend a lot of time searching for these simple facitilies until I realized
that they're really not there yet.

------
fingerprinter
This is really awesome news. I like Play and AKKA is really good.

In the past I've used Erlang/OTP and loved it, but with this news, I might use
this instead.

------
dk8996
Slick, although looks promising, is not ready. Lack of documentation,
examples, and voodoo syntax. If anyone can tell me what $, #$, and +? inside
sqlu statement are?

So here is something I found. Its a benchmark for some of the ORM frameworks
out there. Slick doesn't do too well.

[http://databen.ch/](http://databen.ch/)

------
trailfox
I'm interested to see the effects of the spray optimization work making its
way into Play.

