Web Architecture, Java Ecosystem, Software Craftsmanship

Why I Moved Back from Gradle to Maven

Posted on Apr 2, 2018

Why I Moved Back from Gradle to Maven

“Maven is old school” they said. “Use Gradle instead. It’s the future of building Java applications” they said. Sounds like something you don’t want to miss. So I tried Gradle in two real-world projects. In this post, I like to tell you about my experiences with Gradle and why I finally migrated back to Maven. It’s a story about enthusiasm and disillusionment.

Talk 'Kotlin in Practice' at the JavaLand 2018

Posted on Mar 15, 2018

Talk 'Kotlin in Practice' at the JavaLand 2018

On March 13, 2018, I held a talk about “Kotlin in Practice” at the JavaLand Conference. The conference was awesome and 1900 people attended. I guess about 300 folks came to my talk although it was so early in the morning. That was awesome! Thank you so much! Special thanks go out to the guys that approached me after the talk and the kind tweets. I’m still euphoric. :-)

Best Practices for Unit Testing in Kotlin

Posted on Feb 12, 2018

Best Practices for Unit Testing in Kotlin

Unit Testing in Kotlin is fun and tricky at the same time. We can benefit a lot from Kotlin’s powerful language features to write readable and concise unit tests. But in order to write idiomatic Kotlin test code in the first place, there is a certain test setup required. This post contains best practices and guidelines to write unit test code in Kotlin that is idiomatic, readable, concise and produces reasonable failure messages.

Web API Pagination with the 'Timestamp_ID' Continuation Token

Posted on Jan 31, 2018

Web API Pagination with the 'Timestamp_ID' Continuation Token

In the last post, I presented the Timestamp_Offset_Checkum continuation token for implementing web API pagination. After using them in practice for a while we discovered some drawbacks and finally came up with a new approach: Timestamp_ID. This approach is fast, scalable, efficient, stateless and easy to implement. Our pursuit of the best pagination strategy has finally come to an end.

Web API Pagination with the 'Timestamp_Offset_Checksum' Continuation Token

Posted on Dec 13, 2017

Web API Pagination with the 'Timestamp_Offset_Checksum' Continuation Token

Implementing proper pagination for Web APIs is not trivial. Offering limit and offset query parameters doesn’t cut it because this approach is slow and error-prone. But also keyset paginations with parameters like modified_since have drawbacks. Fortunately, there is a better approach: Continuation Tokens (aka Cursors). They provide fast, reliable and stateless pagination and make the client implementation very straight-forward. In this post, I propose the Timestamp_Offset_Checksum continuation token, the algorithm and point to a library simplifying its implementation.

How to Increase your JVM Development Productivity

Posted on Oct 22, 2017

How to Increase your JVM Development Productivity

During development, it’s important to have fast feedback loops after code changes. Waiting for a cold restart of the application is not satisfying at all and slows down the development process. In this post, I show how we can reduce the turnaround time by using certain JVM arguments and class reloading. Besides those framework-independent means, I’ll give some tips for Vaadin and Spring Boot applications.

Do-It-Yourself ORM as an Alternative to Hibernate

Posted on Oct 5, 2017

Do-It-Yourself ORM as an Alternative to Hibernate

Hibernate is my daily business. And it bugs me. Hibernate adds non-trivial complexity to your application and restricts the flexibility in terms of the query capabilities and the class design. Fortunately, there are many alternatives available. In this post, I like to recap some drawbacks of Hibernate and present an alternative: Do-it-yourself ORM with plain SQL, Spring’s JdbcTemplate and compact mapping code powered by Kotlin.

Talk 'Kotlin in Practice' at the JUG Saxony Day 2017 in Dresden

Posted on Aug 31, 2017

Talk 'Kotlin in Practice' at the JUG Saxony Day 2017 in Dresden

On September 29, 2017, I will give a talk about ‘Kotlin in Practice’ at the JUG Saxony Day in Dresden. In my talk, I will give a short introduction to Kotlin and talk about the experiences we made at Spreadshirt with Kotlin. I’ll show how we can benefit from Kotlin when it comes to popular Java frameworks and if there are pitfalls we have to pay attention to. I’m really looking forward to this conference and I’m happy to be part of it.

Don't use In-Memory Databases (H2, Fongo) for Tests

Posted on Aug 21, 2017

Don't use In-Memory Databases (H2, Fongo) for Tests

At a first glance, in-memory databases (like H2 or Fongo) look like a good idea. You can test your code without having to worry about installing and managing a dedicated database server up front. Just start your tests and the H2 database will be up and running. However, this comfort comes with severe drawbacks. In this post, I explain my reservations and point out Docker as an alternative which can be easily used with TestContainers or within the Gradle/Maven build.

Debugging within a PHP Docker Container using IDEA/PhpStorm and Xdebug

Posted on Aug 15, 2017

Debugging within a PHP Docker Container using IDEA/PhpStorm and Xdebug

Running PHP and an Apache in a Docker container is very handy for local development. But how can we debug the PHP code running in the container? In this post, I show you how to configure Xdebug in a PHP container and configure IntelliJ IDEA Ultimate or PhpStorm for remote debugging.