Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Groovy, Scala maybe making my life easier?

Is it possible to replace any java coding which I use daily with groovy or scala? E.g. writing small webapps which include servlets/portlets etc.

like image 589
onigunn Avatar asked Dec 09 '22 18:12

onigunn


1 Answers

I've completely replaced my server side processing/data crunching that would previously be written in Java with Scala. It's made life a lot easier, and a lot more fun.

  • Small servlets for REST webservices written on top of Step (web pico "framework", it's a single code file, comically small servlet wrapper) http://github.com/alandipert/step. Scala's xml handling combined with a simple json outputter (I use Twitter's) makes this completely painless.
  • Hibernate + Annotations as my persistence layer (very painless once you've cleaned up the Hibernate's collection handling/types)
  • Various data crunching background tasks.

It's certainly possible, and a really simple transition to make. Just start writing Scala as if you were writing Java, at it's worst it's just Java but much less verbose. From there you can gradually pick up the Scala concepts over time: Options, functional concepts, closures etc.

like image 188
Michael Avatar answered Dec 21 '22 12:12

Michael