views:

321

answers:

2

I am making my first foray into scala for a production app. The app is currently packaged as a war file. My plan is to create a jar file of the scala compiled artifacts and add that into the lib folder for the war file. My enhancement is a mysql-backed app exposed via Jersey & will be integrated with a 3rd party site via HttpClient invocations. I know how to do this via plain java. But when doing it in scala, there are several decision points that I am pussyfooting on.

  1. scala 2.7.7 or 2.8 RC ?
  2. JDBC via querulous Is this API ready for production ?
  3. sbt vs maven. I am comfortable with maven.
  4. Is there a scala idiomatic wrapper for HttpClient (or should I use it just like in java) ?

I'd love to hear your comments and experiences on starting out with scala. Thanks

+11  A: 
  1. I would use 2.8.0. There are just too many useful features in 2.8. Besides, 2.8 is closing in on a final release. If you're just starting out, why not start out with that? FWIW, I've been using 2.8.0 since Beta1, in various tools and libraries that I use daily. While there have been bugs, they haven't been enough to make me fall back to 2.7.7. YMMV, though.
  2. This isn't going to make your decision any easier, but there are other possibilities for database access. I've been using SQueryL, for instance; I like it. ORBroker is another option.
  3. If you're comfortable with Maven, then use it, by all means. Personally, I prefer SBT. I get the full power of a real programming language, when I need to implement special build logic. Just as useful, I don't have to deal with XML configuration files. (XML is good for data, but it's a crappy format for a human-edited configuration file.)
  4. You might try Databinder Dispatch. See this article for a nice overview.
Brian Clapper
+3  A: 
  1. If you're only going to start development, Scala 2.8 GA will probably be available by the time you go production. Even if it's not, I would choose the freshest 2.8RC pack rather than sticking to 2.7.7. 2.8 not only has a number of great features, but also contains lots of 2.7.7 bugfixes.
  2. There're not too many production-ready ORMs designed for Scala these days. I would probably choose Lift Persistence, because of the team of professionals and friendly community behind Lift Framework. But if you don't want to risk, you should consider using old good proven Java ORMs: Hibernate, JPA, iBatis (that was recently renamed to myBatis), etc.
  3. You should give SBT a try! It's compatible with maven POMs, so migration to SBT shouldn't be too painful for you. Benefits from using SBT:
    • It's designed for Scala, so you will be relieved from the burden of maintaining countless number of plugins for Maven to make it work with Scala consistently
    • You will be able to write build scripts in Scala (it's an amazing experience compared with XMLs)
    • SBT has a killer feature - continuous whatever (building, testing, deploying). SBT monitors your code, detects when its changed, and triggers an action (test, re-deployment, etc.).
Vasil Remeniuk