my blog. for you.

Let’s talk digital.

I’m an independent IT consultant and entrepreneur in the Internet and software business. I’m interested in design, enterprise applications, web apps and SaaS products. I design and develop business solutions and applications. I help companies in terms of software quality and knowledge transfer, e.g. with Angular and Spring Boot.

Aborting UNIX Processes Running Under a Specific TCP Port

As a longtime UNIX (of the macOS variety) / Linux user, it's kind of embarrassing that only recently I was made aware of this single command (or rather - in a true UNIX fashion: a composition of two commands) that allows you to stop a UNIX process running under a specific TCP port (e.g., a Spring Boot application or an Angular front-end during development) - rather than browsing for that port in a process list first and then manually using the ... Read more

Code Review Checklist and Tool Recommendations

Quite some time ago, both the code quality tool provider Codacy and the software architect Surender Reddy Gutha individually published useful resources on how to do effective code reviews and which tools to use for those: Code Review Checklist – To Perform Effective Code Reviews List of tools for code review engineers While unfortunately the two Pull Panda tools and ReadyforReview from the latter list are no longer available, the remaining tools as well as the checklist from the first article can be still ... Read more

Inheriting Properties for Lombok @Builders and JPA Entities

Lombok is one of those helpful developer tools for the Java language ecosystem that streamline (or even do away with entirely) the more tedious and mundane tasks in software development. Lombok in particular vastly reduces the boilerplate code Java developers have to write by providing annotations that have code for common structures and patterns such as constructors, getters and setters, and builders automatically generated. While tremendously helpful, sometimes edge cases can occur when working with theses kinds of abstractions and as a ... Read more

Spring Boot 3.0 Migration Guide

With Spring Boot 3 having been released two weeks ago, I'd like to explicitly mention the Spring Boot 3.0 migration guide again (also for personal reference and documentation purposes). While migrating to Spring Boot 3.0 in most cases will be a rather straightforward endeavour, it's good to always have clear and concise guidelines at hand to facilitate such an upgrade and to make the migration process more reliable and predictable. Read more

Problem Spring Web: A Library for Handling Problems in Spring Web MVC

Problem Spring Web is an implementation of the proposed application/problem+json HTTP API problem details response for Spring Web (im both its MVC and WebFlux flavours). Error responses should be a first-class citizen when it comes to providing REST APIs. These responses often are generated in an ad-hoc, non-standardised fashion, which not only makes handling such responses more difficult and tedious in client applications but also makes for less maintainable software in the back-end software providing the API. Problem Spring Web attempts to ... Read more

New Java Features From Java 8 to Java 17: A Comprehensive Overview (Including Examples)

This useful article on Java Features from Java 8 to Java 17 (published on Reflectoring) provides a comprehensive overview of Java language features for each of the major Java versions that have ben released since 2014. Such a list comes in handy not only when dealing with different Java versions for different applications or projects but, especially due to the examples provided, can also serve as a conducive starting point for (re-)familiarising oneself with the features added to the core language with ... Read more

Performing Effective Code Reviews – A Checklist

A few years ago, software architect Surender Reddy Gutha compiled a - still quite relevant - Code Review Checklist. All too often, when performing code reviews, we as software engineers tend to focus on minute details such as code formatting rather than the big picture, non-functional requirements, or architecture and security considerations. Perhaps, the problem already originates with the term code review: Rather than reviewing code we are - or should be - reviewing the resulting software and the impact code changes ... Read more

Documenting REST APIs Provided by Express Applications

swagger-jsdoc is an NPM library that allows us to generate an OpenAPI specification for REST APIs provided by an Express application. swagger-jsdoc consumes YAML-formatted OpenAPI specification segments within JSDoc comments annotated with the @openapi annotation and turns those into a comprehensive OpenAPI specification for our API. This specification, in turn, can for example be used for automatically having a Swagger UI documentation page created for our REST APIs (using Swagger UI Express, for instance). While annotating Express routes with syntactically and semantically correct OpenAPI ... Read more

Clearing the Spring Security Context During Unit Testing

Last week I wrote about a minimal Spring Security Context setup for unit testing. I'd like to add just a tiny, yet depending on your use case perhaps quite important, tidbit to that: In case you need to reset a SecurityContext setup, e.g., a mocked user authentication, because, for instance, other test methods from the same unit test class verify behaviour for an unauthenticated application state and hence expect an anonymous user, you can clear the SecurityContext (for example, in your ... Read more

Minimal Spring Security Context Setup for Unit Testing

Creating a minimal Spring Security setup for JUnit unit tests can be a tedious as well as somewhat daunting task. With its Authentication, Principal, GrantedAuthority, and UserDetails classes Spring Security is extremely flexible and configurable and probably accommodates pretty much every authentication and authorization use case under the sun. However, in software architecture such flexibility often comes at price, the trade-off in this case being that simple use cases can require more implementation effort than one would expect. One such use case ... Read more
Next Page »