Tag: Java

  • Mastering Data Validation in Java Applications

    Mastering Data Validation in Java Applications

    The article emphasizes the importance of validating data before it enters the database to prevent issues like NullPointerExceptions and inconsistent data. It advocates for early validation at both the controller and domain model levels, using annotations and custom validators for cleaner, simpler code, ultimately leading to enhanced application reliability.

  • Multi-Environment Configuration in Spring Boot

    Multi-Environment Configuration in Spring Boot

    In this article, I talk about the importance of proper configuration in Spring Boot applications across multiple environments. By using Maven profiles, environment variables, and CI/CD pipelines, developers can maintain clean and flexible configurations. The goal is to ensure a seamless application experience whether running locally or in production, without the risk of misconfigurations.

  • Optional vs Null

    Optional vs Null

    The article discusses the limitations and proper use of Optional in Java to prevent NullPointerExceptions. While Optional offers a way to avoid nulls, it doesn’t eliminate the need for thoughtful design. It emphasizes functional programming techniques to handle empty values effectively without excessive null checks, advocating for clearer code over mere null avoidance.

  • How to Create a Singleton with Java Enums

    How to Create a Singleton with Java Enums

    The Singleton Design Pattern ensures a class has only one instance, facilitating global access. Traditional implementation can lead to issues in multi-threaded environments. A more efficient approach using enums guarantees thread-safety, with built-in properties resembling a Singleton. While useful, overusing this pattern complicates testing and should be approached cautiously.

  • How to Organize the Packages of your Project?

    How to Organize the Packages of your Project?

    Struggling with the eternal Java dilemma of how to organize your project? You’re not alone. From feature-focused structures to classic layer-based setups, choosing the right package organization can make or break your sanity (and your code). In this article, we explore how to structure your Java project effectively, whether you’re working on a sleek online…

  • Authenticate Your Spring Application With AWS Cognito

    Authenticate Your Spring Application With AWS Cognito

    Recently, I needed to create an authentication system for one of my applications. But I need to create it quickly and securely. I may use a JWT with email and password, but people are lazy creating new passwords. So, I choose for a social Sign-In with AWS Cognito.

  • Where To Write Documentation

    Where To Write Documentation

    I can use Word file, a private Wiki or write the documentation into comments inside the code base. Which one is the best? What are the advantages and disadvantages of each documentation? In this post, I explain 3 types of documentation, with their advantages and disadvantages.

  • OAuth2 With Google, Spring Boot And Angular

    OAuth2 With Google, Spring Boot And Angular

    In this article, I describe how to create the Google OAuth2 client, how to connect Spring Security to Google OAuth2 workflow, and have a React frontend to communicate with my Spring Boot application.

  • Feature Flags: Deploy Unstable Features

    Feature Flags: Deploy Unstable Features

    In this article I describe the features flags. I explain when I use them and how I use them in different situations. I explain the needed maintenance and the final clean up.

  • Optimize Your API Using Memoization

    Optimize Your API Using Memoization

    In this article I describe how to use the memoization to optimize the response time of a request. I explain how to prepare the code and how to apply the solution.