Developing with Scala and PlayFramework

This series of post is dedicated to development of applications using Scala programming language and Play framework.

I worked on several projects during my career. Obviously, all technologies were set, either by historic reasons or by company’s policy. I am a big fan of Scala programming language. Unfortunately, I have not yet been able to find a commercial project to be implemented in Scala and Scala’s libraries and frameworks.

In this series, I’d like to showcase Scala, by building a simple educational game called Scalactica2D (name is inspired by the Battlestar Galactica)

Apart from work, I have studied programming languages themselves. The biggest eye opener for me was the Scala programming language and all talks, books and Coursera courses by M. Odersky. Scala language was influenced by several programming languages and tried to pick the best of all worlds. The result is far from perfect. But I could understand why Scala picked those particular features. I could understand, that various languages have various approaches for solving similar kinds of problems.┬áThis understanding of mine culminated with the best Coursera course ever: Programming languages by Dan Grossman. I highly recommend everyone taking this course. You will be exposed to ML, Lisp and Ruby and solve same problems using three different programming paradigms. At the end, I became a better programmer in my two main career programming languages, Java and PHP. Exposing myself to Scala had the same effect. To be clear, you don’t have to become an expert in that many languages. I don’t think it’s even possible, mostly because it takes a lot of time to learn vast ecosystems of existing libraries. The intend is only to open your mind, understand repeating patterns and apply them effectively to language of your choice. The cover of “Real World Haskell book” contains such endorsement from Simon Peyton Jones: When you have worked through these pages, you’ll write better code in your current favorite language.

Now, let’s talk about how I want to develop my game.
I know, that my application will use following:

  1. Play framework
  2. Compile time dependency injection
  3. SQL, migrations, scalikeJDBC
  4. ScalaJS
  5. Akka

Conceptually, I want to ensure following properties of the code and the development process itself:

  1. Static safety
  2. Immutability
  3. No code duplication
  4. Proper database transaction handling
  5. Frequent refactoring

Let’s create a minimal SBT project first

Leave a Reply

Your email address will not be published. Required fields are marked *