Recent Posts
Undertow REST API
Part of my daily routine is to consume, design and deliver services built for HTTP clients. This might manifest in something special like WebSocket, Protobuf but most often a plain JSON REST API. In any case, the performance is key, and an Undertow REST API with JAX-RS can deliver a stable performance under consistent load.
In this article, I will cover some basics for setting up and deploying a REST API with Undertow, in Docker.
read more
Golang flyweight pattern
The flyweight pattern is a design pattern I am not seeing that often in code bases but can be a good design pattern to reduce memory. The core idea is to initialize objects an share them as often as possible for reuse. Mostly the flyweight pattern can be seen in desktop UI implementation (GUI). In Java Swing, for instance, the JTable rendering uses this pattern, to reduce the computation needed for painting.
read more
Golang singleton pattern
There are a number of design patterns I am using on daily bases, and one of them is the Singleton pattern. In Golang penalties in performance are not so harsh as in other languages, if the application is not designed and written to perform with minimal CPU and memory footprint. I’m trying to keep my implementations as performing as possible, but sometimes explicit benchmarks can revile the details.
The singleton pattern is widely used in Object Oriented languages, and it is well worth to use it in golang.
read more