(Also, using the Flyway module has made life a lot easier. play-evolutions is a bit wonky.)
That's how we do it anyways.
My pet peeve is that SBT suffers from ungoogleable scalaz like operators like %% instead of %. And that the Scala IDE doesn't provide any help like code completion, marking compilation errors e.d. in creating your project/Build.scala Those two facts make sbt a big hurdle in adoption I noticed.
The problem I'm referring to is that, for a long time at least (I know pre-2.1, maybe 2.1 as well), there was no way to aggregate non-Play projects--that is, ones that didn't have a conf directory and did have their own pom.xml or whatever--and use the recompiler. So if you were trying to build your project using an external Java/Scala domain object library that could be shared between projects and wanted it to hot-recompile while you're working (because I at least don't write every model class before I get going) you were in for a world of hurt.
I even did a presentation with examples for my local Scala User Group: http://slid.es/samsmoot/some-sbt
http://play.lighthouseapp.com/projects/82401/tickets/453-nee...
Ben's patch made the workaround less terrible for 2.1, but it's still a really weird hacky thing to me and I never got it working with my Maven projects (my preferred backend uses Dropwizard so using a sbt project wasn't really optimal at the time).
If you approach it with a "Play first" mindset and ignore that any of the Play build-cycle stuff only works because it's built on SBT it's going to be rough going.
An "SBT first" mindset makes it much easier.
Create three console apps in three different folders. Doesn't matter where on your system these live.
Now create a fourth directory, add a project sub-folder and a `Build.scala`. Aggregate the projects together and make Project-C a dependency of Projects A and B. A and B are otherwise completely unrelated.
Now when you drop into the SBT console you can run test, compile, etc. All your standard aggregation tasks. If you wanted to actually run A or B, you can run the `run` task and it'll ask you what main-class to execute.
Here's the only real difference as far as Play is concerned: It doesn't use the standard SBT `run` task. So to get the `run` task from the Play plugin you first need to select your Play sub-project: `project my-play-project`. Now you can run `run` and it'll work like a normal Play application.
I think that extra step is actually resolved in Play 2.2 (it uses the standard `run` task now I've heard).
In this setup your "root project" isn't your Play app. It's a code-less project just defining the build and dependencies between your projects. You could add your common project to the Play app's Build.scala, and use `file()` in the Project declaration for it. The project can live anywhere. It's not at all necessary it be in a sub-path, use symlinks, anything like that.
In SBT 0.13 it's even better since you can do almost everything in .sbt files, which unlike a Build.scala can be built up across several projects. So Play-App-A can read the build.sbt from ../common/build.sbt and use that. Where a Build.scala has to be all-encompasing, so your common project configuration would have to reside in my-play-project-a/project/Build.scala.
SBT really is very nice. :-) I've used Maven, Bundler, Buildr, etc. Written my own JRuby Maven+Rubygems build tool (http://github.com/sam/doubleshot). The docs for SBT are real heavy, but if you set aside a few hours to watch some presentations on Parleys, Youtube, etc, it's pretty easy to get into.
Feel free to ping me if you're interested and could use a hand.
The dirty *nix hack for this is to symlink the shared library; otherwise, converting the lib to a plugin is one way toward creating reusable cross-application libraries.
I always thought the status quo in the web development world was to use a framework like Backbone.JS to communicate with your backend and use a client-side template engine to render the templates.
For a while we used templates for the container page, and then backbone and js templating for certain elements on the page. It can become the 2013 equivalent of spaghetti code if you're not careful.
Now, with HTML via AJAX, you have a clear separation of concerns. For example: the designer doesn't need a dev to make an HTML change, and the dev knows that there will be one place that controls how pages are rendered.
There are basically three aspects of website performance - server performance, network performance, and client performance. You can control server performance and network latency (CDN), but you can't control what's going on on your users computers.
For example, if they're tab-abusers (guilty as charged) with 50+ non-trivial tabs open, plus other apps open and stuff running in the background, then your beautiful high-performance UI could start chugging (as many do on my abused laptop).
So you really have to think about what your main userbase will be and whether you need to put the rendering chunk of your app's CPU usage on your own servers or on your client's desktops/laptops/tablets/phones.
[1]: https://blog.twitter.com/2012/improving-performance-twitterc...
- http://openmymind.net/2012/5/30/Client-Side-vs-Server-Side-R...
Note that Play doesn't force you to use the templates, you can plug in your own very easily or forgo them entirely and just push JSON out for client-side rendering.
We use that for monitoring our backend Akka cluster: Play streams JSON using server-sent events to the client for rendering Mustache.js templates.
I don't know the exact motivation for including compiled templates (we love them) but in practice Play is perfectly happy either way.
Don't forget about Play's truly excellent form generation/validation, and yes, raw speed of jvm byte code.
Rails truly (DHH) made a blog post on why they switched to generating html server-side: http://37signals.com/svn/posts/3112-how-basecamp-next-got-to...
Play templates are particularly speedy though, they get compiled into JVM bytecode. I actually prefer doing things that way and keeping markup and JS to a minimum. It 'feels' faster and more robust to me.
I agree that documentation is still lackluster. I would add that although I love the Scala templates, the support for html forms in Scala is a bit clunky. Also there are still a few too many changes requiring code refactoring on minor releases, but I accept those as a byproduct of quick iterations/improvements.
I imagine we'll move it to Play eventually but right now we're focused on the backend (Play/Akka) because that's where everything really happens.
What we love about Play:
* Async everything, especially the web service library
* JSON macros
* Scala-based templates
* Integration with Akka
* Support for server-sent events (we use this for cluster monitoring)
What we wish was better:
* JSON deserialization performance isn't as good as raw Jackson yet. (Our PR regarding this is actually in 2.2, should be better now)
* Documentation could be much better, we still have to resort to the API to figure out a lot of stuff
I've been using Play ever since the 2.0-RC days and it's definitely made some huge gains since then. We use Akka very heavily, especially its clustering, and Play works well in conjunction with that though there are still some gotchas lurking about.
Our backend is one big Akka cluster right now. We've had a few hiccups but overall it's been a hugely enjoyable experience.