Home » JVM Languages

JVM Languages

Make Your Groovy Objects More Bullet-Proof

Groovy has the Immutable annotation which allows to create immutable classes, which is a prerequisite for creating value objects. Unfortunately, when a class has been annotated with Immutable it’s no longer possible to add your own constructor to verify if provided parameters are not null, which would make our value objects really bullet-proof. @groovy.transform.Immutable class Money { BigDecimal amount } ...

Read More »

Kotlintest and property based testing

I was very happy to see that Kotlintest, a port of the excellent scalatest in Kotlin, supports property based testing. I was introduced to property based testing through the excellent “Functional programming in Scala” book. The idea behind property based testing is simple – the behavior of a program is described as a property and the testing framework generates random data to validate the ...

Read More »

Grails 3.3 has Spock 1.1

You’ll be glad to know that milestone 1 of Grails 3.3 has been released 3 days ago — and is also already available through SDKMAN!. Not only has it upgraded its dependencies to Hibernate 5.1.5, Spring Framework 4.3.7, Spring Boot 1.5.3 and Gradle 3.5, but it also finally ships with the latest Spock 1.1 testing framework. Spock is an old ...

Read More »

Play and SBT basics

Previously we had an introduction to sbt, its default tasks and how to add extra tasks. Play comes with the sbt console. The SBT console is a development console based on sbt that allows you to manage a Play application’s complete development cycle. Let us create a play application using sbt and see the commands provided. sbt new playframework/play-scala-seed.g8 [warn] ...

Read More »

SBT basics

Sbt is the de facto build tool in the Scala community. Being used to other build tools you will be familiar with the commands clean – Deletes files produced by the build, such as generated sources, compiled classes, and task caches. compile – Compiles sources test – Executes all tests package – Produces the main artifact, such as a binary ...

Read More »

Use JSON with Play and Scala

Once getting your hands into typing scala code using play, the first thing that comes to mind is JSON. Without doubt JSON is one of the most basic components of web applications. Rest apis use json, your angular app has to consume json and the list goes on. If you are lazy like me, you expect that it is sufficient ...

Read More »

SQL Data Access in Play using Scala

Today’s modern application frameworks come with apromise of easy sql data access. There is no wonder why we have so many frameworks that make it easier to issue queries and handle transactions. SQL is the lingua franca of most applications when it comes to databases. Play comes with the JDBC plugin. We encountered the JDBC plugin previously in order to ...

Read More »

Database Initialization with play and Scala

Once starting your play prototype application one of the priorities is to initialize your database and also manage the database schema changes. Play provides us with evolutions. By utilizing evolutions we are able to create our database and to manage any futures changes to the schema. To get started we need  to add the jdbc dependency and the evolutions dependency. libraryDependencies ...

Read More »