For testing a restful service API I was looking for a lean library, which would allow me to test CRUD operations of rest services with as little code as possible.
My search led me to Dispatch, which is a highly compact Scala DSL wrapper around Apache’s reliable HttpClient. This DSL, however, is not very well documented and rather hard to decipher due to it’s heavy usage of symbolic method names but nevertheless highly appealing when understood.
In this blog I’ll decipher it for you and show how easy it is to test restful services with mere oneliners.
Filed under Scala, Uncategorized | 2 Comments »
Getting the Java out of your Scala, part 2
I’m still trying to get rid of old habits, to shake of my winter hide, so to speak, and create some real Scala in stead of ScaVa (i.e. Java with a Scala syntax). If you’re interested you can bear witness to my struggle on GitHub (ShoppingList on GitHub). This story came about because I asked some colleagues for help. We ended up rewriting loops in several ways.
What I’ll show you is some alternatives to classic loops over collections.
(more…)
Filed under Scala | 3 Comments »
Abstract types in Scala can make your life much easier. In this blog I’m going to recap my intellectual journey to compare ‘apples to pears’ in a typesafe manner, which led me to abstract types.
Filed under Scala, Uncategorized | 10 Comments »
Since my pet project (I will eventually blog about that) is in desperate need of a database and I’m doing enough Java on my day job I decided to give a Scala ORM framework a shot.
I have to warn you that I’m kind of a Scala hacker. I abuse it like a scripting language and usually grab some examples, put them together and wait for my colleagues to say “You don’t want that” or “You’re doing it wrong”. So don’t hesitate to correct me, maybe I’ll learn something too
The Scala Option type is key for dealing with variables that can have values or not. Most libraries and applications make use of this handy type. However, it’s usage in certain cases can lead to rather verbose code. This blog explains how to deal with this particular case in an elegant way using implicits. Read on to see how easy it is to tailor any kind of existing Scala type to perfectly fit your needs based on an example with Options.
(more…)
Filed under Scala, Uncategorized | 7 Comments »
To get some grip on the configuration of the Weblogic domains and servers at my current client, I created a tool that reads domain config files and translates them in a graph. I decided to solve this problem in Scala, mainly because I read about its powerful native XML parsing capabilities. Parsing XML turned out to be a total no-brainer, but I managed to learn something about how to solve problems the Scala way, so this is a story about Scala rather than parsing XML in Scala.
(more…)
Tags: Scala
Filed under Scala | 8 Comments »
This week I visited the stronghold of Scala, EPFL, in order to certify as ‘official’ Scala Trainer. It was an impressive visit, whose highlights I have transformed into this blog.
(more…)
Filed under Scala | 8 Comments »