I basically hit everyone on the head with Scala code in our last project, as I got sick of debugging the same problems caused by a lack of understanding of Hibernate + JBoss. (It's amazing, really. The developers who wrote the original system are still there and still get lost in Hibernate details.)
What we had -> a wacky system built mostly with a bunch of stateless EJB beans wired together with some hibernate code tossed together with some SQL. (We're an ASP, basically. The production cluster is fairly small -> only around 100 machines.)
What I did -> put together various REST-based services, where we redefined the RPC between some of the servers. This is making everything very easy to code, plus, implementing a public API into what was a system where no attention was paid to dependencies.
So far, we've started to deploy code in and out of JBoss instances with no real problems. The first time you try to use a Scala object
in Java, you'll probably wrinkle your nose. But otherwise, nobody really noticed.
So far, it's been about 5 months since we really started. We've done a couple of major revisions, and subsequently are behind, but the system is far, far better tested than in the past. So, while we've had some bad ideas sneak in there while we were really learning the system, we've now been able to remove them all, and, get very close to production deployment. All in all, I'd say the typical dude needs 2-3 months to stop coding like a Java programmer, and get "familiar" with most of the standard libraries.
Writing JDBC code instead of an ORM system basically has thrown out almost all of our performance problems. The speed has been actually significantly better, but that was mostly because I was able to do everything I wanted with less real application code.
Tools I'm using:
- Restlet : Very happy with this framework. Our restlet layer is outrageously trivial code.
- JDBC -> note: we've tweaked what was basically there in the wiki
- XML (and soon, JSON)
- buildr, maven on a couple of projects I didn't want to convert (plus Nexus and Hudson). I'm experimenting with sbt, which is already very nice for scala projects.
We've had absolutely no problems with reusing any of the old java libraries, but we do tend to wrap them in scala-fied layers. Mostly just to write less code.
And the pimp my library pattern is by far the most important one to be familiar with. The "cake" pattern is nice, but you have to control instantiation, which sometimes isn't quite useful. I have also used Guice in a mixed environment, not really hard, either. But I find that mixing code is way less useful than I originally thought, though that's probably because I'm replacing a lot of really, really bad Java code.
My editing environment is mostly TextMate on OS X, but we deploy on Linux servers.
P.S. Yes, I know this is about 4 months old, but whatever. It's relevant, especially now that we have some experience.