Philipp Hauer's Blog

Engineering Management, Java Ecosystem, Kotlin, Sociology of Software Development

Web Development

Vaadin 10+: SASS Integration and CSS Refresh during Development

Posted on Apr 15, 2019

Vaadin 10+: SASS Integration and CSS Refresh during Development

Since Vaadin 10, SASS is no longer supported out of the box. Fortunately, it’s really easy to integrate SASS in a Vaadin 10+ app and its Maven build. But how can we ensure a fast feedback cycle during the SASS development? Restarting the app is cumbersome. Even a page reload would reset the UI state, which leads to annoying clicking through the app. Luckily, there is an approach that automatically exchanges the changed CSS without any browser refresh or app restart.

Self-Contained Systems in Practice with Vaadin and Feeds

Posted on May 16, 2018

Self-Contained Systems in Practice with Vaadin and Feeds

The term Microservices is quite vague as it leaves many questions unanswered. Contrarily, a Self-Contained Systems subsumes concrete recommendations and best practices that can guide you to create an application which is resilient and independent. But how can we implement such a system? At Spreadshirt, we build an application following the recommendations of a Self-Contained System. In this post, I’ll show you which technologies we used and which challenges we faced.

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.

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.

A Test Mail Server for a PHP Docker Container

Posted on Jul 24, 2017

A Test Mail Server for a PHP Docker Container

For a small PHP project, I created a Docker container with an Apache and PHP in order to ease local development and setup. But that was not enough because my PHP application also sends mails and I wanted to test this feature locally as well. That’s why I needed a local SMTP server for testing and integrate it into my current Docker composition. In this brief post, I show you how I achieved this.

RESTful API Documentation with Swagger and AsciiDoc

Posted on Feb 19, 2017

RESTful API Documentation with Swagger and AsciiDoc

Writing documentation manually for a RESTful API can be laborious. On the other hand, relying exclusively on the generation of the documentation (e.g. with swagger-ui) is often not sufficient. There are always aspects (like common use cases and workflows) that need to be described manually. Let’s see how we can combine these two approaches with the help of AsciiDoc!

Moving from Wordpress to Hugo

Posted on Jan 29, 2017

Moving from Wordpress to Hugo

Wordpress bugs me. It slows down the authoring process and comes with security issues and maintenance efforts. That’s why I moved to Hugo. Hugo is a static website generator and allows me to write effectively and offline. In this post, I show my reasons for moving from Wordpress to Hugo and point out tips and tricks for the migration.

Kotlin in Practice with Spring Boot and Vaadin

Posted on Dec 21, 2016

Kotlin in Practice with Spring Boot and Vaadin

Coding with Kotlin is great fun. But things are getting really interesting when we try to use Kotlin in conjunction with popular frameworks like Spring Boot and Vaadin. The development with those frameworks can benefit a lot from Kotlin. However, we have to pay attention to some pitfalls.

Testing RESTful Services in Java: Best Practices

Posted on Mar 29, 2016

Testing RESTful Services in Java: Best Practices

Testing RESTful Web Services can be cumbersome because you have to deal with low-level concerns which can make your tests verbose, hard to read and to maintain. Fortunately, there are libraries and best practices helping you to keep your integration tests concise, clean, decoupled and maintainable. This post covers those best practices.

Analyzing the Memory Usage of a Vaadin Application

Posted on Dec 17, 2015

Analyzing the Memory Usage of a Vaadin Application

Does your Vaadin application scale well? As Vaadin holds the UI state of every user on the server-side, the used server memory increases with every active user. So can our Vaadin application deal with an increased amount of users in terms of the used memory? We will find out! In this post I present tools and approaches to investigate the memory footprint of our Vaadin application.

Enriching RESTful Services with Swagger

Posted on Jul 28, 2015

Enriching RESTful Services with Swagger

Consuming RESTful services can be a laborious task, because there is much low-level-work to do. Jealously we looked at the WS*/SOAP guys: They can easily generate a nice client API based on the formal interface specification WSDL. This significantly simplifies the service consumption. For a long time the REST world lacks a widespread formal specification and generation tools. But Swagger sets out to change this.

Microservices in a Nutshell. Pros and Cons.

Posted on Apr 11, 2015

Microservices in a Nutshell. Pros and Cons.

Microservices are an interesting approach for achieving modularization of an application. An application is built as a set of services. These services can be independently developed, tested, built, deployed and scaled. However, microservices are not suitable for every use case. This post discusses the benefits and drawbacks of microservices.

RESTful API Design. Best Practices in a Nutshell.

Posted on Mar 4, 2015

RESTful API Design. Best Practices in a Nutshell.

Designing HTTP and RESTful APIs can be tricky as there is no official and enforced standard. Basically, there are many ways of implementing an API but some of them have proven in practice and are widley adopted. This post covers best practices for building HTTP and RESTful APIs. We’ll talk about URL structure, HTTP methods, creating and updating resources, designing relationships, payload formats, pagination, versioning and many more.

Evaluating Vaadin: Strengths and Weaknesses

Posted on Feb 16, 2015

Evaluating Vaadin: Strengths and Weaknesses

Vaadin is a mature web framework for developing rich internet applications. Building web-based GUIs with Vaadin feels like developing a desktop application, which is great, comfortable and fast. However, there are situations where Vaadin is not suitable. In this article, we take a look at the architecture of Vaadin and point out its strengths and weaknesses. Let’s start.