Category: Java
-
Escape the If Jungle
Modern Conditional Strategies in Java Classic Conditionals: Advanced or Alternative Structures: Now, let’s write a class that demonstrates a few of the more interesting and non-obvious ones: using enum with behavior, map of commands, and polymorphism. 📦 ConditionalStructuresShowcase.java This class shows three strong alternatives to conditionals: The java project can be found here.
Written by
-
📨 Modern Messaging with Spring Boot and ActiveMQ
Why Messaging Matters in Modern Applications In a distributed system, services often need to communicate asynchronously to ensure decoupling, scalability and resilience. Messaging systems enable this by allowing services to send and receive messages without needing to know about each other’s existence or availability in real time. This pattern is crucial in microservices, event-driven architectures…
Written by
-
Understanding One-to-One Relationships: Database vs Java (Hibernate)
When modeling One-to-One relationships, you can approach it in several ways depending on the ownership, lifecycle, and data modeling constraints. While Java and Hibernate offer flexibility in how this relationship is implemented at the code level, the root of it lies in database design. So let’s start there. One-to-One Relationship Strategies in Database Engineering In…
Written by
-
Does Garbage Collector Choice Matters for Microservices?
When building and deploying microservices with Java — whether using Spring Boot or WildFly — one of the often-overlooked performance factors is the Garbage Collector (GC). Should you care about which GC your application uses? Or should you leave it to the infrastructure? Let’s break it down. Why Garbage Collector Choice Matters Garbage Collection is…
Written by
-
Mastering MapStruct
@Mapping, @AfterMapping, and @MappingTarget in Action 🧩 Introduction In modern Java applications, especially with frameworks like Spring Boot, object mapping is a common task. Whether you’re transforming DTOs into entities or mapping between domain layers, doing this manually is tedious and error-prone. MapStruct is a compile-time code generator that simplifies this task—fast, type-safe, and easy…
Written by