dsl

Easy DSL design with Kotlin

In Android, every tutorial teaching you the basics describe how to design screen through XML files. It’s also possible to achieve the same result with Java (or any JVM-based language). Android screen design is not the only domain where XML and Java are valid options. For example, Spring configuration and Vaadin screen design allow both. In all those domains, there’s however a trade-off involved: on one hand, XML has a quite rigid structure enforced by an XML-schema while Java gives po

microservice Spring Framework Spring Cloud Kotlin HTTP monitoring Sleuth

HTTP headers forwarding in microservices

Microservices are not a trend anymore. Like it or not, they are here to stay. Yet, there’s a huge gap before embracing the microservice architecture and implementing them right. As a reminder, one might first want to check the many fallacies of distributed computed. Among all requirements necessary to overcome them is the ability to follow one HTTP request along microservices involved in a specific business scenario - for monitoring and debugging purpose. One possible implementation of it

design API extension function

Extension functions for more consistent APIs

Kotlin’s extension functions are a great way to add behavior to a type sitting outside one’s control - the JDK or a third-party library. For example, the JDK’s String class offers the toLowerCase() and toUpperCase() methods but nothing to capitalize the string. In Kotlin, this can be helped by adding the desired behavior to the String class through an extension function: fun String.capitalize() = when { length < 2 -> toUpperCase() else -> Character.toUpperC

typesafe

Type-safe annotations

I don’t like dynamically-typed languages - scripting languages in other terms. Of course, I’ve to live with Javascript because it’s so ubiquitous on the web, but given the chance, I’d switch to TypeScript in an instant. I was amazed by a demo of the Griffon GUI framework, and have read some pretty good stuff about the Spock testing framework, but I barely looked at them because they are based on Groovy, a scripting language (even if it offers optional enforcement of types

good practice cargo culting over-engineering interface

Are you guilty of over-engineering?

If you listen to other language communities - such as Python or Ruby, it seems Java developers have a strong tendency of over-engineering. Perhaps they’re just jealous of our superior platform (wink), perhaps there is some very slight reason that they believe so. I do believe so. And it’s quite interesting that I realized it by doing code review - while I may be guilty of over-engineering myself when writing code. But I’m working on it. Of course, you’re a 'simple' dev

SEO vaadin volga

Adventures in SEO with Vaadin

TL;DR: Vaadin was hardly SEO-friendly in the past. Not anymore, with the new Volga library. Bookmarking pages Bookmarking is as old as www itself. Being able to save an URL is part of the ADN of websites. Regarding web apps, this is somewhat different. For example, in an e-commerce webapp, while it does make sense to bookmark a specific product, bookmarking a specific step of the checkout process does not. Following the shop example, here’s what happens in a traditional servlet-based

technical debt refactoring software engineering

Limits of the technical debt analogy

The triangle of project management is a well-known model, used through and through since ages. I assume most software developers, even junior ones, are familiar with those: TimeCostScope As for my personal experience in the software industry, all projects have been behind schedule, with only a few exceptions for small projects (some man-months). The reason might probably because initial estimations were too low, either by accident or on purpose, but that is a subject best tackled in anothe

scala kotlin

Scala vs Kotlin: inline and infix

This is the 3rd post in the Scala vs. Kotlin focus series. This week, I’d like to address two features: inline and infix - not because they’re related but because neither of them would be enough to fill a post. Inlining comes from C (and then C++). In those languages, a hint could be provided to the compiler through the inline keyword. By doing so, it may replace an inlined function call by the function body itself in order to skip the overhead of a function call.