Latest Posts

Performance September 20, 2023

Your Java Application in Detail: Performance Analysis with JMX and JDK Mission Control

When it comes to analyzing the performance or behavior of a Java application, Java Management Extensions (JMX) is a valuable tool. In this article, we will explore how you can utilize JMX to profile your application, particularly with the use of JDK Mission Control (JMC). JMX: A Quick Overview JMX provides a simple and standardized method for monitoring and managing Java applications. With JMX, you can access various metrics and information about your JVM and even adjust real-time settings.

Spring September 13, 2023

Spring Events: Decouple Your Application with @EventListener and ApplicationEvents

If you’re already working with the Spring Framework, you’ve undoubtedly recognized its power and versatility. One of the valuable - yet often overlooked - features of Spring is its event-handling system. In this article, we’ll delve deeper into how you can configure events in the Spring Framework using @EventListener. Moreover, we’ll illustrate how these events can be paired with transactions and asynchronicity. Why Events in the Spring Framework? Events are an integral component of the Spring Framework.

Spring September 6, 2023

Spring's Assert Class: The Smart Way to Validate

There are many ways to ensure your code does what it’s supposed to do. Java even has a built-in assert language feature for this very purpose. And then there’s Spring’s Assert class. But why should I use this? In this article, we delve deeply into the subject and explore the advantages of using this class for validating your data and arguments. Why Use Assertions at All? Before diving into the details of the Spring Assert class, let’s briefly clarify the significance of assertions.

Spring August 30, 2023

Open Session in View (OSIV) in Spring - Enable or Disable?

If you are working with Spring Boot and Hibernate, you have undoubtedly come across the term “Open Session in View” (OSIV) or its corresponding property open-in-view. But what exactly does this option do, and how does it affect your interaction with the database? Should you enable or disable it? In this article, we delve deep into the topic and shed light on its functionality and differences compared to other approaches.

Spring August 23, 2023

Spring MVC: How to Use a Custom Converter for Type Safety in Controllers

Are your controllers constantly filled with primitives? In ArticleController, the first line of every method is: articleRepository.findById(articleId). We keep making the same conversions. I hardly observe as many primitives in any other layer as in the API layer. This leads to much boilerplate. The code becomes harder to test. And it’s harder to read. Yet we know how much easier it is when we work with type safety. In this article, I will show you how to use the Converter Interface to automatically convert your primitives into the correct type.