Tag: Java
-

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
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?
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
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
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
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
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
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.
-

Deploy A Spring Boot Application in AWS Lambda
In the article of today, I’m gonna explain how to deploy a Spring Boot application in AWS Lambda. I want to deploy a complete web application into a serverless platform. The difference is that I want to create several endpoints in my Spring Boot application. And I want to map them all to a single…
-

4 Ways to Protect Your Application From Being Hacked
In this article I describe 4 ways to secure an application to avoid 90% of the attacks. 4 simple ways to put in place in every kind of application. From using HTTPs to an external configuration system.
