The Asynchronous Software Factory
The Asynchronous Software Factory
my personal blog about software development
The Asynchronous Software Factory
Test doubles
Play Framework supports functional testing out of the box. There are helpers for both Scala (specs2, ScalaTest) and Java (JUnit). The basic idea is to run code under test inside a “fake” application. For code it will look like it is running in a normal Play application with access to plugins, configuration parameters and other parts of the runtime environment. A fake application can be started…
While we are waiting for HTTP/2 to be widely adopted, there is a simple trick that can make our applications faster - batch API. It allows clients to encode multiple API calls into one HTTP request. Here are some examples of different batch API implementations: Facebook, Google, Dropbox
There are two general ways to generate code: string templates and abstract syntax tree building. In Scala world we have a couple of options to build an abstract syntax tree. So, in this post I’m going to compare three different approaches:
Have you ever wondered how is Scala able to do some clever trick on top of JVM? Or maybe you have asked yourself “WTF is wrong” while starring at a piece of code? That is what happened to me yesterday. I was trying to figure out some magic about case classes and pattern matching. And even worse I wanted to replicate some of it myself. After spending hours googling I was ready to start decompiling…
I was working on a couple of fairly complicated Play application recently. In order to keep complexity at an acceptably low level we broke the apps into sub-modules. Every sub-module is a Play application on it’s own and can be worked on, launched and tested separately. Then there is an aggregating app that takes care of making everyone play together. More about composing Play apps out of…
In many cases you may need to get an enumeration constant by it’s name. It is very easy to do it if you extend the standard Scala Enumeration class to create your enumeration. Below is a typical enumeration implementation:
Few days ago I came across an article describing how to create a blog using GitHub pages and Jekyll. The idea of creating a blog post by committing it into your Git repo looked kind of fun to me, so I decided to give it a try. This post is the place where I will keep the journal of the experiment.