Java

What’s the difference between Concurrency and Parallelism?

Concurrency and Parallelism are important concepts for bringing more efficiency to software, but they do not mean the same thing. A software application can handle multiple tasks, and the way these tasks are processed differs in each concept. Concurrency Imagine the scenario where we have a software that needs to process multiple tasks, such as…

Read More
AWS

What is AWS Global Infrastructure?

AWS is able to offer services that are fast, resilient, and accessible from anywhere in the world. This is possible thanks to its global infrastructure — one of Amazon Web Services’ greatest advantages. The following image helps illustrate how it works. Regions These are independent geographic regions that contain multiple Availability Zones (AZs). This way,…

Read More

How to create a custom repository in Spring Data JPA?

Spring Data JPA is great for abstracting away boilerplate code when accessing the database. It allows us to create query methods by simply defining method signatures. But sometimes, we need more complex or dynamic queries — and that’s where custom repositories come into play. In this post, I’ll show how to create a custom repository…

Read More

What is Spring Data JPA?

Spring Data JPA is a module of Spring Data that simplifies the implementation of repositories. It provides an automatic way to create repository implementations based on Java interfaces, eliminating the need to manually write the repository implementation. To make this work, you need to create an interface using the @Repository annotation and extend JpaRepository. The…

Read More
Java

How to avoid NullPointerException in Java using Optional?

Optional was introduced in Java 8 as a way to handle potentially null values more safely and expressively. It helps to avoid NullPointerException and makes the code more readable. Hands on Creating an Optional Optional can be created in several ways: Printing the results will show the following output. Checking for Value Presence Optional provides…

Read More

How to create an Interceptor in Angular and Why?

In Angular, an Interceptor is an feature that allows intercepting HTTP requests . This enables you to add logic such as: Hands on We can create an Interceptor with the following command. Now, let’s create an Interceptor to add JWT tokens. This is a real example of an Interceptor. We have a service that retrieves…

Read More

What is algorithm complexity?

Algorithm complexity is a fundamental concept in computer science, used to measure the efficiency of an algorithm in terms of execution time and memory usage. By analyzing complexity, we can predict how an algorithm behaves as the input size increases, allowing us to choose more appropriate solutions for different problems. How do we measure it?…

Read More
Java

How do @PostConstruct and @PreDestroy annotation work in java?

Methods annotated with @PostConstruct and @PreDestroy are commonly used in the lifecycle of beans managed by the container, such as in frameworks like Spring or Quarkus. An example of their use is opening and closing database connections. If you want to know more about Bean management in Spring, don’t hesitate to read this post. @PostConstruct…

Read More
Java

How do functional interfaces work in Java?

Functional Interfaces are a fundamental concept in functional programming introduced in Java 8. They are interfaces that have exactly one abstract method, allowing the use of lambda expressions and method references to make the code more concise and readable. They can be used in Streams, for example, and promote code reuse. We can find several…

Read More

How do @Input and @Output work in Angular?

In Angular, @Input and @Output are essential decorators that facilitate communication between components. They allow data to be passed from a parent to a child component (@Input) and events to be emitted from a child to a parent component (@Output). @Input It allows the child component to receive values from the parent component. The parent…

Read More