Tag: Java
Fault Tolerance in Quarkus
Natan Ferreira- 0
- 145
Systems can face issues, including failures in one or more components. For example, external APIs and databases may fail. This can cause a major negative impact on the system, which is why there are ways to handle these failures. Quarkus uses the SmallRye Fault Tolerance specification to make the system more resilient. These techniques are…
Read More
How OpenRewrite Turns Legacy Java into Modern Java?
Natan Ferreira- 0
- 227
Maintaining a Java system up to date is not just a matter of performance or access to new features — it is a matter of security, support, and software longevity. However, migrating a project from an older Java version to a newer one usually involves a significant manual effort: refactoring code, adapting APIs, reviewing thousands…
Read More
🧠 Understanding Stacks in Java with a Real Example
Natan Ferreira- 0
- 298
When working with algorithms, data structures like Stacks play a crucial role in solving problems efficiently. A Stack follows a simple but powerful principle: LIFO (Last In, First Out) — the last element you add is the first one to be removed. Think of a stack like a pile of books: you can only remove…
Read More
How to Grouping and restricting constraints using Bean Validation?
Natan Ferreira- 0
- 407
We already know that the Bean Validation specification is very helpful for performing validations. There is also the possibility of validating using groups. Imagine the following scenario: a DTO for products and another one for categories, as in the following example: When trying to register a product by specifying the category id, we encounter an…
Read More
What is Java Bean Validation and how to use it?
Natan Ferreira- 0
- 626
Bean Validation is a specification for performing validations in Java and can have multiple implementations. To avoid writing repetitive validation code, Java provides Bean Validation (standard specified by JSR 380, also known as Jakarta Bean Validation), which allows applying rules directly to class attributes using annotations. When developing Java applications, it is common to validate…
Read More
Why is it important to study data structures and algorithms?
Natan Ferreira- 0
- 287
One day I was talking to a friend who is learning programming. I suggested solving a problem to check whether a word or phrase is a palindrome. We entered a prompt asking to AI for this and received a response using Java’s StringBuilder. The solution was correct, but with a more critical eye, I thought…
Read More
How to use Domain Events in Spring?
Natan Ferreira- 0
- 331
In the world of Domain-Driven Design (DDD), Domain Events are a powerful way to notify different parts of a system that something meaningful has occurred within the core domain. Within the Spring ecosystem, event support is simple yet highly effective for decoupling components, improving cohesion, and enabling systems to evolve gracefully. In this post, you’ll…
Read More
How to create an interceptor in Quarkus?
Natan Ferreira- 0
- 839
When developing REST APIs, it’s common to want to intercept requests and responses to log information, validate data, or even apply business rules and security checks. In JAX-RS-based applications, like those using Quarkus, this is possible using request and response filters. In this post, we’ll explore how to implement a simple interceptor in Quarkus that…
Read More
Timezones in Java: How to Schedule Classes Correctly Across Time Zones?
Natan Ferreira- 0
- 287
Imagine you’re developing a platform like Cambly, where students and teachers are spread across the globe. A student in Brazil wants to schedule a class at 10:00 AM local time with a teacher living in Australia. How can you ensure that both are connected at the right time, even though they’re in different time zones?…
Read More
How to avoid race condition in shared resources in Java?
Natan Ferreira- 0
- 333
Sharing resources between threads can be a challenging task, as it requires ensuring that operations are atomic. What is a resource? A resource can be variables, data structures, files, messages, etc. In Java, we have two important memory areas: the Stack and the Heap. Why use shared resources between threads? There are many reasons, but…
Read More